Prev: Thanks, guys \o/ \o/ was: Re: Persuading an Atheros wireless card to function in Lenny
Next: Debian-Multimedia
From: Vadkan Jozsef on 20 Feb 2010 09:50 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: rename [-v] [-n] [-f] perlexpr [filenames] $ rename 's/;$//g' * Unknown option: -vol.-01-disk-cantatas-bwv-3; Usage: rename [-v] [-n] [-f] perlexpr [filenames] What is the regexp to get this filename?: vol-01-disk-cantatas-bwv-3 Thank you:) -- To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org Archive: http://lists.debian.org/1266677069.6612.0.camel(a)ubuntu
From: Camaleón on 20 Feb 2010 10:20 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)... *** sm01(a)stt008:~/Desktop$ rename -n "s/---vol./vol/" $HOME/Desktop/---vol.-01-disk-cantatas-bwv-3 /home/sm01/Desktop/---vol.-01-disk-cantatas-bwv-3 renamed as /home/sm01/Desktop/vol-01-disk-cantatas-bwv-3 *** Greetings, -- Camaleón -- To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org Archive: http://lists.debian.org/pan.2010.02.20.15.11.05(a)gmail.com
From: Stephen Powell on 20 Feb 2010 10:30 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] > > > $ 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: rename [-v] [-n] [-f] perlexpr [filenames] > > > What is the regexp to get this filename?: > > vol-01-disk-cantatas-bwv-3 > > Thank you:) I guess I'm not really sure what you want, but if all you want to do is rename ---vol.-01-disk-cantatas-bwv-3; to vol-01-disk-cantatas-bwv-3 The command is mv -- ---vol.-01-disk-cantatas-bwv-3\; vol-01-disk-cantatas-bwv-3 Two things are significant. First, the double hyphen (--) after mv tells mv that this is the end of the options list and anything after it that starts with a hyphen is to be interpreted as a command argument instead of a command option. Second, the backslash (\) in front of the semicolon (;) causes the semicolon to be interpreted by the shell as part of the filename and not as a command separator. Normally, the semicolon is used to separate multiple commands on a single line. -- To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org Archive: http://lists.debian.org/500651757.13824951266679323475.JavaMail.root(a)md01.wow.synacor.com
From: Jörg-Volker Peetz on 20 Feb 2010 16:00 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. -- To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org Archive: http://lists.debian.org/hlpb22$kio$1(a)ger.gmane.org
From: Jörg-Volker Peetz on 20 Feb 2010 16:10 (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 doesn't interpret the filenames as switches. -- Regards, Jörg-Volker. -- To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org Archive: http://lists.debian.org/hlpboh$kio$2(a)ger.gmane.org
|
Next
|
Last
Pages: 1 2 Prev: Thanks, guys \o/ \o/ was: Re: Persuading an Atheros wireless card to function in Lenny Next: Debian-Multimedia |