for i in *.cfg; do mv $i $i.bak;sed \’s/a/b/\’ $i.bak > $i; done
The above command is very useful to change certain regular expressions in couple of files in one directory. This can be used in variety of ways to achieve a lot of things which would normally take some time to do manually.
- 2010/01/21 sed tutorial and help
- 2010/03/04 Bash histoy – common history in different terminals
- 2010/03/02 Bash Sub Shells
- 2009/12/18 Display a block of text with delineated by a start pattern and an end pattern
- 2009/11/05 Linux xdg-open — replacement for start in windows