Jianping Zhu wrote:
sed is your friend.how to substutue string in a text file by using "gerp" or "find"?I have a text file, lof of "abdfggg" in that text file, i need to change it to "opsmsdd", is there a simple way to do that?
sed 's/abdfggg/opsmsdd/g' <infile> > <outfile>
That will replace ALL instances of abdfggg with opmsmdd in file infile, and write it to outfile.
Be sure that the redirect goes to a new file. If you try to redirect it back into the original file, you'll be hosed after the first line.
Cheers!
Ric
--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list