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

IFS='
'

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