X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 q=dns; s=default; b=hlwk1luR3d9V/zf8ONLNWLHMHCya//+MS3Ma8bJMLnT
	HVLZ20cT3JONCbBwCW2xzZy9fgmXRuYyY9purG0RS5EZvydUIMbDV4V/T8G2dZGp
	Em/iMtogwTul6L9UL4hqZ3UBIuMK+D4IAKk2AapdTL+UGJ4eFigbYsoUscnGRuNM
	=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 s=default; bh=yjItNLBBpL2glVyqIfg8r//aReQ=; b=K1Whi2n1fQeRpofT4
	N/w7t1lQ6CeAPiI/xuj5x7tsP+vMfrrfr/VyYJOI1DX0MpZOHOJqh1U2UTvRunYn
	fTi5LvVvamo24S4CSkdiU6FM26ZMNaylSzzxY8oF1BOjHjAjY26LD/PZnLFnBMtR
	l8tEAR2c5Yx4Zw7qStc3tVrDRk=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_40 autolearn=ham version=3.3.2
X-HELO: knockando.watchfront.net.uk
Message-ID: <54663FB9.2010800@hones.org.uk>
Date: Fri, 14 Nov 2014 17:45:29 +0000
From: Cliff Hones <cliff@hones.org.uk>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: sed anomaly in bash script
References: <CABa6CE=OFjPjomA9xQESG==MTjP9y=5UqeTgtg4fxnZjYqTEuw@mail.gmail.com>
In-Reply-To: <CABa6CE=OFjPjomA9xQESG==MTjP9y=5UqeTgtg4fxnZjYqTEuw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/) (knockando.watchfront.net.uk)
X-Spam-Report: knockando.watchfront.net.uk has scanned this email for spam. Results:-	T_RP_MATCHES_RCVD=-0.01 (total -0.0, current threshold 5.0)
X-IsSubscribed: yes

On 14/11/2014 17:20, cyg Simple wrote:
> $ TEST=`echo 'c:\windows' | sed -e s.\\.\\\\.g`
> $ echo $TEST
> c:\\windows
> 
> <file name=sed.sh>
> TEST=`echo 'c:\windows' | sed -e s.\\\.\\\\\.g'
> echo $TEST
> </file>
> 
> $ bash -x sed.sh
> ++ echo 'c:\windows'
> ++ sed -e 's.\.\g'
> sed -e expression #1, char 7: unterminated 's' command
> + TEST=
> + echo
> 
> CYGWIN_NT-6.1 HOSTNAME 1.7.32(0.274/5/3) 2014-08-13 23:06 x86_64 Cygwin
> 
> Does anyone have a suggestion on turning c:\windows into c:\\windows?

Try:
TEST=$(echo 'c:\windows' | sed -e 's.\\.\\\\.g')
echo $TEST

-- Cliff



--
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

