X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-0.6 required=5.0	tests=AWL,BAYES_40,RCVD_IN_DNSWL_NONE
X-Spam-Check-By: sourceware.org
Message-ID: <4CEE6175.2030805@bonhard.uklinux.net>
Date: Thu, 25 Nov 2010 13:15:33 +0000
From: Fergus <fergus@bonhard.uklinux.net>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
To: Cygwin ML <cygwin@cygwin.com>
CC: Fergus <fergus@bonhard.uklinux.net>
Subject: Re: Portable Cygwin: replacing drivename in a text file
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

> I can't get the syntax quite right.
> Can anybody help, please? Thank you very much.

Thanks very much indeed for various suggestions, much appreciated. I
guess by yakking on about "drivename" I moved the focus of my question
to its practical application and thereby managed to blur things. My real
question is

Given the string 123 how can I use sed to change it to 1$HOME3 or, in my
case, 1/home/user3. Various combinations of ' " and ` (also arbitrary
separators) all fail as in

echo 123 | sed 's/2/"$HOME"/g'
echo 123 | sed 's/2/`$HOME`/g'
echo 123 | sed "s/2/'"$HOME"'/g"
echo 123 | sed 's/2/@$HOME@/g'

Thank you (again).

Fergus



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

