/usr/bin/mcpmv is in mrename 1.2-13.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #!/bin/bash
#
# MASS RENAME V 1.2
# (c) 2000 Giancarlo Erra <rofus@mindless.com>
# This software is under the GNU Public License (GPL)
#
#
# This script is launched by mrename with all necessary parameters
# Do not launch this script manually.
#
# Variables: $2=<prefix> $nnumber=<progressive-number> $mfile=<oldname>
#
# this is the most untested and buggy string...
mfile=$(echo $1 | sed 's/\.\///')
if [ $3 == "copy" ]
then
number=$(cat ./.mrename-c)
nnumber=$[$number+1]
echo "$nnumber" > ./.mrename-c
# This command rename with format <prefix-number-oldname>
# copying files (that is using cp command)
cp "$mfile" "$2$nnumber$mfile"
# If you want to rename with format <number-prefix-oldname>
# uncomment the line below
#
# cp $mfile $nnumber$2$mfile
#
# and comment the previous "cp $mfile $2$nnumber$mfile"
elif [ $3 == "move" ]
then
number=$(cat ./.mrename-c)
nnumber=$[$number+1]
echo "$nnumber" > ./.mrename-c
# This command rename with format <prefix-number-oldname>
# moving files (that is using mv command)
mv "$mfile" "$2$nnumber$mfile"
# If you want to rename with format <number-prefix-oldname>
# uncomment the line below
#
# mv $mfile $nnumber$2$mfile
#
# and comment the previous "mv $mfile $2$nnumber$mfile"
fi
# THE END ;)
|