Quick tip to change parameters in different files
2010-03-16
54 words
1 min read
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.
Related Articles:
- 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
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.