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
> "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 ("
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
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 = $_;
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