I have a shell script that I run on Mac computers. It searches for certain characters and replaces them with a - The only character that does not work is the / Using this for One Drive Sync issues as it does not allow the / in the file name and will not sync. I have tried using / and // in the code, but nothing is working correctly. Any ideas? Code: type or pastebadchars='|?*,#;:&@+<>%$~{}\/' find . -name "*[$badchars]*" | while read -r file do target_name=$(echo "$file" | tr "$badchars" - ) echo "Target Name" $target_name if [ "$file" != "$target_name" ]; then if [ -e $target_name ]; then echo "WARNING: $target_name already exists, file not renamed" else echo "Move $file to $target_name" mv "$file" "$target_name" fi fi done