aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Ramos2025-01-14 20:34:06 +0100
committerGuillermo Ramos2025-01-14 23:09:52 +0100
commitc02e37c869cff3939bf191c46c06a8db857d7e9d (patch)
tree08577fdb62b996e45941b5991397c7214e2f6fb3
parent1eb0eda96ace25d81fdf1f34d9177da50c3e0fa9 (diff)
downloadcli-master.tar.gz
-rwxr-xr-xmvall22
1 files changed, 22 insertions, 0 deletions
diff --git a/mvall b/mvall
new file mode 100755
index 0000000..91a7b4f
--- /dev/null
+++ b/mvall
@@ -0,0 +1,22 @@
+#!/usr/bin/env perl
+
+use File::Basename qw<fileparse>;
+use File::Copy qw<move>;
+use File::Path qw<make_path>;
+
+use warnings;
+use strict;
+
+my $dest = shift;
+my @srcs = @ARGV;
+
+my ($name, $path, $suffix) = fileparse($dest, qr/\..*$/);
+make_path($path);
+
+my $n = 1;
+foreach my $src (@srcs) {
+ my $dest = "$path$name$n$suffix";
+ print "$src\n -> $dest\n";
+ move($src, "$dest") || print STDERR " ERROR: $!\n";
+ $n++;
+}