rename command does not work!
Hello!
I'm trying to rename some files with spaces with the 'rename' command and a perl regexp: Code:
rename 's/ //g' * I also tried: Code:
rename ' ' '' * I solved the problem with a bash script, but i like this bad documented command. :) What's wrong with it? :( Thanks :) -- Vinícius André Massuchetto |
You should escape the blank-space. Try
Code:
rename \ "" * |
I also tried this.
and also things like: Code:
rename 's/\ //g'* |
The regexp version does not work for me, too... but the escaped space yes! Can you post the name of the files you are trying to rename? Sorry for the pedantic question, but are you sure to have put another space after the escaped one?
Code:
rename \ "" * |
No problem, here it is...
Code:
-bash-3.00$ ls |
Hi.
I wrote a little script to re-create some of the jpg filenames that you posted. Then, either in a script or as a plain command: Code:
rename 's/ //g' *.jpg Something else might be wrong here. Were you in the directory containing the files? Are you sure that the spaces are spaces? Can you rename any file in that directory? ... cheers, makyo ( edit 1: typo ) |
My problem is not to rename the files, but why
Code:
rename 's/ //g' *.jpg I always used this command, but in this Mandriva Linux 2006 is not working. For renaming, scripts like Code:
for f in *; do Is there a perl lib I must have to run them? Yes, I can normally rename files in the folder. |
All times are GMT -5. The time now is 07:14 AM. |