perl or sed s/// problem
Dale Farnsworth
dale at farnsworth.org
Thu Aug 5 11:58:56 MST 2010
> > Sed seems to have the same problem. Anyone have any ideas on how I
> > can get this to work? And yes, unfortunately, I need to use the
> > variables.
>
> Try something like
>
> $ sed -e "s|$line|$newline|" file
Yes, this is a common solution to this problem. I've often seen, and
have occasionally used, the control-A character used as a delimiter.
It works fine and control-A is unlikely to occur in text. The challenge
then becomes finding how to enter control-A into a script with your
favorite text editor.
-Dale
More information about the PLUG-discuss
mailing list