Hi Team,
i want to replace a string in a file using shell script
for eg:
cat test.xml
This is the file which is used
to show the how to
change a single word in a file
using shell script
-----------------------------------------------------
in the above test.xml file i want to replace the word with script with automate with
can some one help me out.
Regards
Kanna
replacing a string
-
- Posts: 2019
- Joined: 2015/02/17 15:14:33
- Location: Bulgaria
- Contact:
Re: replacing a string
Maybe a oneliner will help (make a backup of the file while testing):
Code: Select all
sed -i'.bkp' 's/some\ strange\ \$tring/replacement\ string/g' /path/to/file/to/be/modified