Hi,
I rasied this problem of mine in another forum but never got an answer as yet.
My problem is, how do I get away with using a variable in sed that contains a slash as in the following example:
var1="ethernet0/0"
sed -n '/$var1/,/whatever/p'
PHV helped me out with another sed senario for replacing text by using exclamation points in place of the slashes that I'm used to.
(sed '1,$s!'"$var1!TEST!g"
I've been unable to figure out how to do it in my above example.Its probably because I don't understand the significance of the !'s ;-)
Thanks .. TJ
I rasied this problem of mine in another forum but never got an answer as yet.
My problem is, how do I get away with using a variable in sed that contains a slash as in the following example:
var1="ethernet0/0"
sed -n '/$var1/,/whatever/p'
PHV helped me out with another sed senario for replacing text by using exclamation points in place of the slashes that I'm used to.
(sed '1,$s!'"$var1!TEST!g"
I've been unable to figure out how to do it in my above example.Its probably because I don't understand the significance of the !'s ;-)
Thanks .. TJ