works as of old
[otp-base.git] / tools / .appgen / rename.sh
blobb18a2111c709339de0deef8d65f90d6b7a9d2603
1 #!/bin/sh
3 if [ "$#" = "3" ]; then
4 OLD_PREFIX=$1
5 NEW_PREFIX=$2
6 FILENAME=$3
7 NEW_FILENAME=$(echo $FILENAME | sed -e "s/$OLD_PREFIX/$NEW_PREFIX/")
8 echo "moving $FILENAME to $NEW_FILENAME"
9 mv $FILENAME $NEW_FILENAME
10 exit 0;
14 if [ "$#" = "2" ]; then
15 while read line;
16 do
17 OLD_PREFIX=$1
18 NEW_PREFIX=$2
19 NEW_FILENAME=$(echo ${line} | sed -e "s/$OLD_PREFIX/$NEW_PREFIX/")
20 echo "moving ${line} to $NEW_FILENAME"
21 mv ${line} $NEW_FILENAME
22 done
23 exit 0