0% found this document useful (0 votes)
42 views

#!/bin/ksh For File in $ Do CP $file $file - Old Sed - e 'S/find/replace/g' $file Done

This script loops through command line arguments, making a backup copy of each file by appending ".old", and then uses sed to search and replace all instances of "find" with "replace" in each file, overwriting the original file with the modified content.

Uploaded by

rav1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

#!/bin/ksh For File in $ Do CP $file $file - Old Sed - e 'S/find/replace/g' $file Done

This script loops through command line arguments, making a backup copy of each file by appending ".old", and then uses sed to search and replace all instances of "find" with "replace" in each file, overwriting the original file with the modified content.

Uploaded by

rav1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#!

/bin/ksh
for file in $* do
cp $file $file.old
sed -e 's/find/replace/g' < $file > $file
done

You might also like