I'm running a shell script to remove all metacharacters with sed with this code.
for file in /path/to/folder/*; do
mv "$file" "$(echo $file | sed "s,[()\^\$\?*+=\|#!@%&-],,g")"
done
It works great, but when I want it to also look for forward slashes ("/") it deletes all files. this is what i used. s,[/()\^\$\?*+=\|#!@%&-],,g
Why is that? and how would I also target forward slashes.
Thanks.