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 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
('echo -e' force backslash-escape sequences expansion independently)

$ shopt xpg_echo
xpg_echo        off
$ echo -e '\r\n' | od -tx1
0000000 0d 0a 0a
0000003
$ shopt -s xpg_echo
$ shopt xpg_echo
xpg_echo        on
$ echo -e '\r\n' | od -tx1
0000000 0d 0a 0a
0000003
$ echo '\r\n' | od -tx1
0000000 0d 0a 0a
0000003



-- 
Mike


--
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


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