Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com From: Chris Faylor Date: Tue, 20 Jun 2000 12:51:40 -0400 To: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Bug of bash with sed operation ??? Message-ID: <20000620125140.B878@cygnus.com> Reply-To: cygwin AT sourceware DOT cygnus DOT com Mail-Followup-To: cygwin AT sourceware DOT cygnus DOT com References: <20000620161558 DOT 22088 DOT qmail AT web106 DOT yahoomail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000620161558.22088.qmail@web106.yahoomail.com>; from earnie_boyd@yahoo.com on Tue, Jun 20, 2000 at 09:15:58AM -0700 On Tue, Jun 20, 2000 at 09:15:58AM -0700, Earnie Boyd wrote: >--- Zhiguang Qian wrote: >> Hi, >> >> Here is the sample. >> >> >>export MY=\aaa\bbb.c >> >>echo $MY | sed -e 's#\\#\/#g' >> >> /aaa/bbb.c >> >>out=`echo $MY | sed -e 's#\\#\/#g'` >> >> sed: -e expression #1, char 8: Unterminated `s' command >> >> Try it. >> > >I just tried it and it worked for me in version 2.03.0(2). I think that 2.03.0(20) must be broken then. This isn't a bug. The quoting rules used in a `..` are different than the rules in '...'. This fails on every system that I tried this on. The problem is that the \ handling is done in the `...` before the '...'. This is a typical problem with quoting in a shell script. At the very least the: export MY=\aaa\bbb.c is probably not doing what the user expects. That is equivalent to: export MY=aaabbb.c cgf >So, what are our differences? It could be sed but I'm thinking that it is a >bug introduced in bash-2.04. -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com