Quote:
Originally Posted by AnanthaP
I expect that it needs a proper substitution format with the g prefix like s/\ //g.
The g prefix for global as opposed to just one substitution.
OK
|
Yes that's the one you want. Watch out though. There is also a weak, unuseful utility with the same name. The real
rename that works and is worth your time is based on perl's File::Rename module:
[code]
$ rename -V
/usr/bin/rename using File::Rename version 0.20
[/code
So you'd just use any normal perl expression that you'd like.
Code:
rename -n 's/ /_/g;' somefiles
Because you can use any perl expressions you can even use it for complex renames, such as renumbering a sequence or reformatting numbers in file names.