Re: Shell - escapes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, May 10, 2016 at 04:19:10PM +0200, Thomas Schmitt wrote:
> Regrettably, Here Documents let the shell fiddle with their text.
>
> $ wc -c <<x
> $(echo hello)
> x
> 6
>
> So this is not a way to express arbitrary literal text.
Not if you quote the delimiter cookie in single quotes (in bash,
at least):
| cat <<EOT
| the current shell is $SHELL, I think
| EOT
|
| => the current shell is /bin/bash, I think
but:
| cat <<'EOT'
| the current shell is $SHELL, I think
| EOT
|
| => the current shell is $SHELL, I think
A bit like Perl (or was it the other way 'round? ;-)
> > Would it be useful / possible to change
>
> One can switch from one shell to the other, one can even program an
> own shell. But i see very few chance that bash or dash upstream would
> accept any change or addition attempt about quoting. It is just too
> fundamental and there are viable ways to express a literal string.
That's my take too. And I think the decision to move slowly, if ever
does make a ton of sense in this context.
regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlcx8MgACgkQBcgs9XrR2kZ3LwCdHCYhbwBUo5KlgsZJoxPOfuXO
p58AnR+iq50k4Hk61RY59/0Fn4boEs64
=IIYV
-----END PGP SIGNATURE-----
Reply to: