To replace text "localhost" to "localnet" in all files with extension text execute following
> perl -p -e "s/localhost/localnet/g" *.txt
To add new line after new text "localnet" use new line code \x0a
> perl -p -e "s/localhost/localnet\x0anew line/g" *.txt
To insert TAB in replaced text use code \x09
> perl -p -e "s/localhost/localnet\x0anew line\x09rest of line after tab/g" *.txt
This blog is created to keep things which I always need to remember in Python and Linux scripting. ... and few other things.
Wednesday, February 24, 2010
Subscribe to:
Post Comments (Atom)
Followers
About Me
- Krzysztof Pakuła
- Znak zodiaku - Lew
No comments:
Post a Comment