bug-bash
[Top][All Lists]
Advanced

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

Re: quoting inside backquotes in 3.1


From: Eric Blake
Subject: Re: quoting inside backquotes in 3.1
Date: Sun, 05 Mar 2006 21:50:31 +0000

> Is it intentional that the following script, which worked in 2.05b now
> produces errors in 3.1:
> 
> : `: "\\""`
> 
> That now results in: unexpected EOF while looking for matching ``'
> Using a third backslash fixes it but this is inconsistent with ash bash2
> bsh ksh pdksh and zsh.

No, it is not intentional, and yes, it is a bug.  Official patch 10 (even the
updated version) and patch 11 do not help here - maybe Chet can
come up with patch 12?

It is a little more obvious what is going on if you use echo instead
of : (that is, echo `echo "\\""`).  The backtick should parse the
first backslash as quoting the second, so that the command
passed to the command substitution is now (echo "\"").  Then
the outer echo reprints the result, for an overall output of " in
a compliant shell.  bash-3.1 is indeed misparsing this construct.

> 
> Oliver
> 
> 
> This e-mail and any attachment is for authorised use by the intended 
> recipient(s) only. 

Too late - it is now publicly archived.  Please don't use unenforceable
legalese trash like this in your emails to public mailing lists - if
necessary, open up a second web-based email account rather
than sending from an account that includes such a disclaimer.

-- 
Eric Blake




reply via email to

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