summaryrefslogtreecommitdiff
path: root/mmv
blob: 746136b58d990e6a86dc597539bbe31d4b92c204 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

if [ -z "$3" ] ; then
    echo usage: $0 from to file_list
    exit 1
fi

from="$1"
to="$2"

shift
shift

for i in $* ; do
    new=$(echo $i | sed "s/$from/$to/g")
    echo mv $i $new
    mv $i $new
done