You are not logged in.
Pages: 1
Hi
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?
thank you
Chris
Offline
Escape the ''s, like "mv ' bla".
Offline
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...
Offline
Use tr "'" "_" or sed "y/'/_/".
Offline
Use tr "'" "_" or sed "y/'/_/".
Yeah, yeah - there's more than one way to beat a horse... errr whatever that saying is
Offline
Ah sorry, I missed the 'g' at the end of the sed command, that works too yes.
Offline
Pages: 1