SED Question
Hi,
I want to replace a string in a file. The string is: $var 1>&2 >> /dev/null & to #$var 1>&2 >> /dev/null &. Appreciate any help. thanx ktr944 |
Quote:
Code:
sed 's/\$var/\#\$var/g' |
Code:
awk '$1=="$var"{print "#"$0;next}1' file |
Daniel Robbins has an excellent article on sed. (I've always thought he was one of the best doc writers around, and that that was one of the main reasons for Gentoo's popularity, but anyway...)
http://www.gentoo.org/doc/en/articles/l-sed1.xml |
Looking at the original question---How about opening a text editor and typing in the "#"?
The obvious question for ktr* is: what is the context?---eg how many lines do you want to change and what do they have in common? |
All times are GMT -5. The time now is 08:37 PM. |