[Sussex] Find & Replace in lots of small files

John Crowhurst info at johnscomputersupport.co.uk
Fri May 18 20:33:07 UTC 2007


On Fri, May 18, 2007 20:31, Bob Williams wrote:
> I have about 3000 shell scripts, each of which contains the same error,
> namely
> a spelling mistake in a path. I am looking for a way to automate the find
> and
> replace I need to do, and wonder if sed is the tool to use?
>
> I've looked at the manpage, but can't seem to work out how to construct
> the
> necessary lines of instructions - or even if it's possible.
>
> Can someone advise, please?

sed -i.old 's#path#newpath#g' *.sh

-- 
John Crowhurst
John's Computer Support




More information about the Sussex mailing list