Skip to content

Instantly share code, notes, and snippets.

@zdying
Created May 11, 2016 07:56
Show Gist options
  • Save zdying/99b8e7aeab46d604a1e0f19a404e372a to your computer and use it in GitHub Desktop.
Save zdying/99b8e7aeab46d604a1e0f19a404e372a to your computer and use it in GitHub Desktop.
批量修改文件内容
setFile(){
echo "处理文件/目录: $1"
for file in $1
do
if [ -d $file ];then
# echo "$file is dir"
setFile "$file*"
elif [ -f $file ];then
echo "处理文件: $file"
echo "<h1>Error :(</h1>" > $file
fi
done
}
setFile ./source/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment