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 -e "net use z: \\\\srv\\aqs /persistent:no /user:%USERNAME%
> > $BG_PASSWD\r"
> [...]
> 
> If that's a bash script, then that has nothing to do with GNU
> coreutils as bash has its own builtin version of echo.
> 
> In any case, there's no bug here. and GNU coreutils echo or the
> bash one behave the same.
> 
> \ is used as an escape character both for the bash language
> within double quotes, and for echo -e.
> 
> echo -e "\\\\"
> 
> Passes 3 arguments to echo: <echo>, <-e> and <\\>

So you need to add another handful of \ characters:

$ echo -e "\\\\\\\\"
\\
$ /bin/echo -e "\\\\\\\\"
\\

Erik



Reply via email to