Quantcast
Viewing all articles
Browse latest Browse all 1989

Parsing a / from a file name

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...
Parsing a / from a file name

Viewing all articles
Browse latest Browse all 1989

Trending Articles