Quote:
Originally Posted by Franklin52
Or simply with tr. Check the -d option in the man page.
|
Great! The only character that do not work is backslah but here my new solution:
Code:
~$ cat myscript
echo "$1" | tr -d "${2//\\/\\\\}"
~$ myscript 'weird string !"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' ' !"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~'
<---------------------- $1 ----------------------> <---------------- $2 ---------------->
weirdstring
~$