If you are doing something like this, but for say 100,000 files, you want your script to invoke as little as possible outside itself. The use of %, %%, # and ## can cut down drastically the amount of sed usage and therefor do a significant amount for the speed and resource usage of your script.
Wow, quite a discussion, I've had several suggestions on how to do it, I'll be at the box in question to do the job at the weekend, many thanks to all who helped. And the discussion is quite cool (makes a change from all the SCO stuff recently - anyone else as bored as me with it?), seems with BASH, as with Perl, TMTOWTDI ;) -- James Ogley, Webmaster, Rubber Turnip james@rubberturnip.org.uk http://www.rubberturnip.org.uk Jabber: riggwelter@myjabber.net Using Free Software since 1994, running GNU/Linux (SuSE 8.2). GNOME updates for SuSE: http://www.usr-local-bin.org