bug-coreutils
[Top][All Lists]
Advanced

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

bug#21416: "--" syntax for ignoring flags doesn't seem to work right wit


From: Eric Blake
Subject: bug#21416: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo
Date: Fri, 4 Sep 2015 16:42:48 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 09/04/2015 04:34 PM, Eric Blake wrote:
> [As it is, bash has a bug:
> $ (shopt -s xpg_echo; echo -e)
> 
> should output '-e', but currently outputs nothing.  Also, bash does not
> quite treat POSIXLY_CORRECT=1 (also spelled 'set -o posix') as the
> override to turn on full POSIX compliance, as it leaves xpg_echo as a
> separate knob; ideally, turning on posix compliance in bash should turn
> on xpg_echo - but enough people are used to the old behavior that it was
> decided to keep the knobs separate]

Maybe I spoke too soon. It looks like bash needs BOTH xpg_echo and posix
mode at the same time, either one in isolation is not enough:

$ for opt in '' 'shopt -s xpg_echo' 'set -o posix' \
     'shopt -s xpg_echo; set -o posix'; do
    bash -c "echo 'trying $opt'; ${opt:-:}; echo -e"
  done
trying

trying shopt -s xpg_echo

trying set -o posix

trying shopt -s xpg_echo; set -o posix
-e

$

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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