[Top][All Lists]

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

Re: sed parsing

From: John Lowe
Subject: Re: sed parsing
Date: Wed, 1 Jun 2005 16:56:53 +0100
User-agent: Turnpike/6.04-M (<PgYoybPDKbYsatlBvTrz9VyzYQ>)

In message <>, Randy Yates <> 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 \

I would try

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

It may even work!
John Lowe

reply via email to

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