initial commit
[otp-base.git] / tools / .appgen / rename.sh
blob9f7af18fb0e1564c7e478c439f61cc276357421e
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