#! /bin/bash
dir
RENAME_DIR=$(pwd)
old key
OLD_WORD=$1
new key
NEW_WORD=$2
modefy filename
echo “modefy filename”
find -type d | sort -r | while read line
do
cd
l
i
n
e
‘
r
e
n
a
m
e
"
s
/
line `rename "s/
line‘rename"s/OLD_WORD/$NEW_WORD/" *`
cd $RENAME_DIR
done
modefy .c file
echo “modefy .c file”
for i in find $RENAME_DIR -name "*.c"
do
sed -i “s/
O
L
D
W
O
R
D
/
OLD_WORD/
OLDWORD/NEW_WORD/g” $i
done
modefy .h file
echo “modefy .h file”
for i in find $RENAME_DIR -name "*.h"
do
sed -i “s/
O
L
D
W
O
R
D
/
OLD_WORD/
OLDWORD/NEW_WORD/g” $i
done
modefy .json file
echo “modefy .json file”
for i in find $RENAME_DIR -name "*.h"
do
sed -i “s/
O
L
D
W
O
R
D
/
OLD_WORD/
OLDWORD/NEW_WORD/g” $i
done