-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 3/9/14, 3:16 AM, Mike Frysinger wrote:
> On Fri 07 Mar 2014 16:15:05 Eduardo A. Bustamante López wrote:
>> dualbus@debian:~$ for shell in /bin/bash ~/local/bin/bash; do "$shell" -c
>> 'p=foo_bar; echo "${p/_/\~} $BASH_VERSION"'; done
>> foo\~bar 4.2.37(1)-release
>> foo~bar 4.3.0(2)-release
>
> you can get same behavior in <=bash-4.2 and >=bash-4.3 by using single quotes:
> P="foo_bar"
> MY_P=${P/_/'~'}
> echo "${MY_P}"
Yes, only the behavior when in double quotes changed.
- --
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlMcqiIACgkQu1hp8GTqdKvMEQCfdHS9nEIi5WxTJxG2cDlSKAKM
5gQAmwQ8hyD5uVNxF5H1JhkNJ2wXJonP
=uLio
-----END PGP SIGNATURE-----