#!/bin/bash
array=(
txt
yml
yaml
properties
js
html
xml
)
function read_dir(){
for file in `ls $1`
do
if [ -d $1"/"$file ];then
# echo "文件夹:" $1"/"$file
read_dir $1"/"$file
else
if [ $file != "replace.sh" ];then
if [[ "${array[@]}" =~ "${file##*.}" ]]; then
echo "文件:" $1"/"$file
sed -i "s/1111111111/eee/g" $1"/"$file
elif [[ ! "${array[@]}" =~ "${file##*.}" ]]; then
echo "忽略文件:" $1"/"$file
fi
fi
fi
done
}
read_dir $1