Re: shell script for removing unprintable characters in file names
- In reply to: Per olof Ljungmark : "shell script for removing unprintable characters in file names"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 08 Dec 2024 05:49:53 UTC
On 30/11/2024 15:33, Per olof Ljungmark wrote: > Hi, > > I am tasked with recovering hundreds or more files created with > unknown OSs and have unknown characters in the name, replaced with a '?'. > > Like file?nam?.??? > > Please, if you have such a script can you post or email it? Replacing > the unknown character with anything, like '-' or '_' using whatever > shell, sh, bash or csh. > > Thanks a lot! This is off-topic, but it appeared (probably as a fortune/tip) on the same day as me reading your email, so I'll throw it into the mix: Want to strip UTF-8 BOM(Byte Order Mark) from given files? sed -e '1s/^\xef\xbb\xbf//' < bomfile > newfile