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

[semi-OT] How to echo \\ in dash



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list!

In an effort to write my scripts in a posix conform way, I try to use
dash instead of bash. One issue I don't understand:

Why does 'echo \\\\' behave different for bash and dash?

It's a bit confusing that one cannot echo two \\ to another file.

15:46:25-johannes@e13-v21:~$ dash
$ echo \\
\
$ echo \\\\
\

15:46:25-johannes@e13-v21:~$ bash
ech15:46:29-johannes@e13-v21:~$ echo \\\\
\\
15:46:32-johannes@e13-v21:~$ echo \\
\

Thanks for clarifications 8-)

Johannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkqX4aoACgkQC1NzPRl9qEUuHACdHufcE036SATOOfV6N9pWFNaS
eWMAnj2QGjOFbRO/IIORuBNTpZIybJT1
=JRfx
-----END PGP SIGNATURE-----


Reply to: