help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sed parsing


From: Randy Yates
Subject: Re: sed parsing
Date: 01 Jun 2005 12:50:26 -0400
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Military Intelligence)

John Lowe <jrnl@bytetype.co.uk> writes:

> In message <xxp3bs2cd7x.fsf@usrts005.corpusers.net>, Randy Yates
> <randy.yates@sonyericsson.com> writes
> 
> >I have a path string, "xyz", that I want to prefix a volume specification
> >to (under MS-Windows), so that I get "v:\xyz". If I use the following
> >
> >  echo "xyz" | sed "s/^/v:\\/"
> >
> >I get a "unterminated `s' command" response. Why? It
> >seems that sed is associating the second "\" in "\\/"
> >with the "\" instead of with the first "\". Why? What
> >is the proper way to accomplish the substitution?
> 
> Under a unix-like operating system the \\ inside "" would be an escape
> sequence for \

Doh! Thanks John. 

  echo "xyz" | sed 's/^/v:\\/'

works.

--RY

> 
> 
> I would try
> 
>    echo "xyz" | sed "s/^/v:\\\\/"
> 
> It may even work!


> -- 
> John Lowe
> jrnl@bytetype.co.uk

-- 
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
randy.yates@sonyericsson.com, 919-472-1124


reply via email to

[Prev in Thread] Current Thread [Next in Thread]