regexp for rename command - please help!

2010-02-20 Thread Vadkan Jozsef
The filename, that i want to rename: ---vol.-01-disk-cantatas-bwv-3; commands, that doesn't work: $ rename 's/^---//g' * Unknown option: -vol.-01-disk-cantatas-bwv-3; Usage: rename [-v] [-n] [-f] perlexpr [filenames] $ rename 's/.-/-/g' * Unknown option: -vol.-01-disk-cantatas-bwv-3; Usage:

Re: regexp for rename command - please help!

2010-02-20 Thread Camaleón
On Sat, 20 Feb 2010 15:44:29 +0100, Vadkan Jozsef wrote: The filename, that i want to rename: ---vol.-01-disk-cantatas-bwv-3; (...) What is the regexp to get this filename?: vol-01-disk-cantatas-bwv-3 After some attemps (:-P)... *** s...@stt008:~/Desktop$ rename -n s/---vol./vol/

Re: regexp for rename command - please help!

2010-02-20 Thread Stephen Powell
On Sat, 20 Feb 2010 09:44:29 -0500 (EST), Vadkan Jozsef wrote: The filename, that i want to rename: ---vol.-01-disk-cantatas-bwv-3; commands, that doesn't work: $ rename 's/^---//g' * Unknown option: -vol.-01-disk-cantatas-bwv-3; Usage: rename [-v] [-n] [-f] perlexpr [filenames]

Re: regexp for rename command - please help!

2010-02-20 Thread Jörg-Volker Peetz
The problem is not the syntax of rename but the name of the files beginning with '-'. So try something like $ rename 's/^---//g' ./* where the shell expands the filenames to ./---vol1 ./---vol2 Then the rename command doesn't interpret the filenames as switches. -- Regards, Jörg-Volker.

Re: regexp for rename command - please help!

2010-02-20 Thread Jörg-Volker Peetz
(Sorry, forgot to adapt the regular expression in my previous mail.) The problem is not the syntax of rename but the name of the files beginning with '-'. So try something like $ rename 's|^\./---||g' ./* where the shell expands the filenames to ./---vol1 ./---vol2 Then the rename command

Re: regexp for rename command - please help!

2010-02-20 Thread Chris Burkhardt
Vadkan Jozsef wrote: The filename, that i want to rename: ---vol.-01-disk-cantatas-bwv-3; commands, that doesn't work: $ rename 's/^---//g' * Unknown option: -vol.-01-disk-cantatas-bwv-3; Usage: rename [-v] [-n] [-f] perlexpr [filenames] Use: rename 's/^---//g' -- * The -- is