delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/11/14/12:46:03

X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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 AT hones DOT org DOT 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 AT cygwin DOT com
Subject: Re: sed anomaly in bash script
References: <CABa6CE=OFjPjomA9xQESG==MTjP9y=5UqeTgtg4fxnZjYqTEuw AT mail DOT gmail DOT com>
In-Reply-To: <CABa6CE=OFjPjomA9xQESG==MTjP9y=5UqeTgtg4fxnZjYqTEuw@mail.gmail.com>
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019