what have I to do to use rename in a shell script?
I want to replace all ' (single quote) in a directory tree with another char. I need this because xargs wont work with such filenames.
The ' are in different positions and in different long filenames, so I cant use the ? spacer.
What else can I do?
Escape the ''s, like "mv ' bla".
I think he's looking for something like:
mv abdc'ewff'efe something
in a "do this for all files" version...
nordlicht: do you want to keep the current filenames? i.e. hello'this'is'a'file becomes hellothisisafile?
for f in `ls *'*`; do mv $f `echo $f | sed -e "s/'/_/g"` done
that should replace single quotes with underscores...
Use tr "'" "_" or sed "y/'/_/".
Ah sorry, I missed the 'g' at the end of the sed command, that works too yes.