Re: Shortest One-liner to Rename Files

2005-11-12 Thread Randy W. Sims
Wijaya Edward wrote: Hi all, I have a snippet that rename files from: "sth.txt.out" into "sth.out" Now I am really curious how can I make this oneliner "even shorter": $ perl -e ' for(glob ("*.txt.out")){ $out = $_; $out =~ s/\.txt(\.out)/\.out/; rename ($_,$out); }' perl -e '/(.*)\.tx

Re: Shortest One-liner to Rename Files

2005-11-11 Thread Randal L. Schwartz
> "Wijaya" == Wijaya Edward <[EMAIL PROTECTED]> writes: Wijaya> Hi all, Wijaya> I have a snippet that rename files from: Wijaya> "sth.txt.out" into Wijaya> "sth.out" Wijaya> Now I am really curious how can I make this Wijaya> oneliner "even shorter": Wijaya> $ perl -e ' Wijaya> for(glob ("

Re: Shortest One-liner to Rename Files

2005-11-10 Thread John W. Krahn
Wijaya Edward wrote: > Hi John, > > From: "John W. Krahn" <[EMAIL PROTECTED]> > >>mmv '*.txt.out' '#1.out' > > you mean just: > > mv '*.txt.out' '#1.out' > > right ? and not "mmv" No, I meant mmv. $ man mmv MMV(1) NAME mmv - move/copy/append/link multiple files by wildcard pattern

Re: Shortest One-liner to Rename Files

2005-11-10 Thread John W. Krahn
Wijaya Edward wrote: > Hi all, Hello, > I have a snippet that rename files from: > "sth.txt.out" into > "sth.out" > > Now I am really curious how can I make this > oneliner "even shorter": mmv '*.txt.out' '#1.out' > $ perl -e ' > for(glob ("*.txt.out")){ for ( <*.txt.out> ) { > $out = $_;

Shortest One-liner to Rename Files

2005-11-10 Thread Wijaya Edward
Hi all, I have a snippet that rename files from: "sth.txt.out" into "sth.out" Now I am really curious how can I make this oneliner "even shorter": $ perl -e ' for(glob ("*.txt.out")){ $out = $_; $out =~ s/\.txt(\.out)/\.out/; rename ($_,$out); }' Hope to hear from you again. -- Regards, Ed