Normally I use the ${parameter/pattern/string} construct
in bash to replace characters.
For example, ${i//(/_} replaces all ( characters with _ in $i.
For illustration:
find . -depth -type d -name '*(*' -execdir bash -c 'for i; do mv "$i" "${i//(/_}"; done' _ {} +
I cannot get it to work with ~.
${i//~/_} yields the value of $i, unchanged,
even if it contains tilde(s).
It's weird – it works with every single other symbol I use except a question mark. Any ideas with the tilde?