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}"
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to