[Gllug] Quoting within sed

Robert Boulter robboulter at hotmail.com
Mon Aug 4 08:23:30 UTC 2003


Many thanks Richard,
  It works,  I am now rereading the man page thoroughly.
Regards Rob.

>From: Richard Cohen <richard at vmlinuz.org>
>Reply-To: Greater London Linux Users Group <gllug at linux.co.uk>
>To: Greater London Linux Users Group <gllug at linux.co.uk>
>Subject: Re: [Gllug] Quoting within sed
>Date: Mon, 4 Aug 2003 08:50:16 +0100 (BST)
>
>On Mon, 4 Aug 2003, Robert Boulter wrote:
>
> > Hi,
> >   I am trying to isssue a sed command to globally alter the directory
> > structure within a shell script.
> >   I have tried all manner of combinations but cannot get round the 
>forward
> > quotes on sed i.e.
> >
> >   $ sed s/usr/usr/cnh/g filename
> >   $ message garbled
>
>sed -e "s,usr,usr/cnh,g" < filename
>
>Or some such... the / isn't magic, you can use any character after the s to
>start a replacement command...
>
> > Here i am trying to change the directory usr to usr/cnh.  However single 
>or
> > double quotes or backslash  does not seem to remove the special meaning 
>the
> > forward slash between usr/cnh has for sed,
> >   i.e
> >   usr'/'cnh
> >   usr"/"cnh
> >   usr\/cnh
> >
> >   does not work.  Any suggestions from a struggling beginner would be
> > welcome.
> > Regards Rob.
>
>Cheers
>Richard
>
>--
>Gllug mailing list  -  Gllug at linux.co.uk
>http://list.ftech.net/mailman/listinfo/gllug

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list