Monday, July 25, 2011

sed with variables

Here is an example of how to get sed to replace values within files with variables:

for a in {1..12} ; do sed -e s/0/"$a"/g myConfig > myConfig$a ; done;


This is useful if you need to have an iterated set of config files, for instance.

No comments: