bug#20553: 'echo -e' does not escape backslash correctly

2015-05-12 Thread Erik Auerswald
Hi, On Mon, May 11, 2015 at 11:17:34PM +0100, Stephane Chazelas wrote: 2015-05-11 23:50:25 +0200, Jo Drexl (FFGR-IT): Hi guys, I had to write a Windows bat file for twentysomething users and - as Linux geek - wrote a small Bash script for it. The code in question is as follows: echo

bug#20553: 'echo -e' does not escape backslash correctly

2015-05-12 Thread Stephane Chazelas
2015-05-11 17:36:50 -0600, Eric Blake: On 05/11/2015 04:14 PM, Pádraig Brady wrote: echo -e net use z: srv\\aqs /persistent:no /user:%USERNAME% $BG_PASSWD\r 'echo -e' is non-portable. POSIX recommends that you use printf instead, as the POSIX version of echo is supposed to behave

bug#20553: 'echo -e' does not escape backslash correctly

2015-05-11 Thread Pádraig Brady
tag 20553 notabug close 20553 stop On 11/05/15 22:50, Jo Drexl (FFGR-IT) wrote: Hi guys, I had to write a Windows bat file for twentysomething users and - as Linux geek - wrote a small Bash script for it. The code in question is as follows: echo -e net use z: srv\\aqs /persistent:no

bug#20553: 'echo -e' does not escape backslash correctly

2015-05-11 Thread Jo Drexl (FFGR-IT)
Hi guys, I had to write a Windows bat file for twentysomething users and - as Linux geek - wrote a small Bash script for it. The code in question is as follows: echo -e net use z: srv\\aqs /persistent:no /user:%USERNAME% $BG_PASSWD\r I expected the created files being as such: net use z:

bug#20553: 'echo -e' does not escape backslash correctly

2015-05-11 Thread Eric Blake
On 05/11/2015 04:14 PM, Pádraig Brady wrote: echo -e net use z: srv\\aqs /persistent:no /user:%USERNAME% $BG_PASSWD\r 'echo -e' is non-portable. POSIX recommends that you use printf instead, as the POSIX version of echo is supposed to behave as follows: $ echo -e 'a\nb' -e a\nb You are

bug#20553: 'echo -e' does not escape backslash correctly

2015-05-11 Thread Stephane Chazelas
2015-05-11 23:50:25 +0200, Jo Drexl (FFGR-IT): Hi guys, I had to write a Windows bat file for twentysomething users and - as Linux geek - wrote a small Bash script for it. The code in question is as follows: echo -e net use z: srv\\aqs /persistent:no /user:%USERNAME% $BG_PASSWD\r [...]