>  > is there a way to replace all in a file?
>
>  :1,$s/old/new/g
>
>  > It would be really good to if there was a way to do it to all file in 
>  > a directory, or perhaps a list of files.
>
>  $ for file in list-of-files
>  > do
>  >    sed 's/old/new/g' $file > $file.new
>  > done

vi can be used to replace occurrences across multiple files, too, 
but it has the disadvantage (or, "AND it has the advantage") 
that you need to close each file manually (presumably
prooofreading before saving (under the same name, by default).

for $fname in list-of-files; do vi +"%s/old/new/g" $fname; done


-----------------------------------------------------------------
To get off this list, send email to [EMAIL PROTECTED]
with Subject: unsubscribe
-----------------------------------------------------------------

Reply via email to