This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ANNOUNCEMENT] Updated: bash-4.3.39-2


On 09/28/2015 10:48 AM, Mikhail Usenko wrote:
> On Mon, 28 Sep 2015 08:56:14 -0600
> Eric Blake <...> wrote:
>>
>> 'echo -n' and 'echo -e' are non-portable (even in bash; because I can
>> use 'shopt -s xpgecho' to get POSIX-mandated behavior).  Use 'printf'
>> instead.
>>
> 
> xpg_echo doesn't change 'echo -ne' behavior

xpg_echo in isolation does not, and POSIXLY_CORRECT in isolation does
not, but together they DO affect echo:

$ bash -c 'echo -n hi'
hi
$ bash -c 'shopt -s xpg_echo; echo -n hi'
hi
$ bash -c 'POSIXLY_CORRECT=1; echo -n hi'
hi
$ bash -c 'POSIXLY_CORRECT=1; shopt -s xpg_echo; echo -n hi'
-n hi

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

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]