tabanna writes:
So, I type < mv *.sah *.zah > ~ result : failure .
How should this command be given ?
I heard about a command named `mmv' command (multiple move), and I vaguely
remember I saw it on SuSE disks.
For such a need, I would probably do:
rename 's/sah/zah/' *.sah
given that `rename' is this short (and old) Perl script:
#!/usr/bin/perl -w
# Tom Christiansen , in alt.sources, 90-12-08.
# Modified by François Pinard , 91-04-19.
#
# rename script examples from lwall:
# rename 's/\.orig$//' *.orig
# rename 'y/A-Z/a-z/ unless /^Make/' *
# rename '$_ .= ".bad"' *.f
# rename 'print "$_: "; s/foo/bar/ if <stdin> =~ /^y/i' *
$operation = shift;
for (@ARGV) {
$previous = $_;
eval $operation;
die $@ if $@;
if ($previous ne $_) {
if (-f $_) {
warn "$0: $_ already exists\n";
} else {
rename($previous, $_)
|| warn "$0: can't rename $previous to $_: $!\n";
}
}
}
Yes, agreed. I should rewrite it in Python. Good idea! :-)
--
François Pinard http://www.iro.umontreal.ca/~pinard
--
To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com
For additional commands send e-mail to suse-linux-e-help@suse.com
Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/