用shell替换文件中的字符串
2011-05-26 15:23
246 查看
用shell替换文件中的字符串,创建两个文件
# file convert.sh
#file rule.sed
# file convert.sh
# file convert.sh #!/bin/sh for filename in `find . -name "*.htm"` do echo Deal with $filename ... sed -f rule.sed $filename > $filename'.tmp' rm -f $filename mv $filename'.tmp' $filename echo " [done!]" done
#file rule.sed
#file rule.sed s/xxxxx/yyyy/g
相关文章推荐
- 使用shell命令sed将指定目录下的所有文件中指定的字符串替换成指定的字符串
- shell 脚本替换文件中某个字符串
- shell脚本:以一定规律替换某个目录下某些文件中的某个字符串
- 「Shell」macOS系统下替换文件中的字符串
- shell 批量替换多个文件中字符串
- shell脚本中调用vim 替换指定路径下文件中的字符串
- shell 脚本替换文件中某个字符串
- Mac shell 文件批量替换字符串
- shell 脚本替换文件中某个字符串
- shell 脚本替换文件中某个字符串
- Shell脚本执行hive语句 | hive以日期建立分区表 | linux schedule程序 | sed替换文件字符串 | shell判断hdfs文件目录是否存在
- shell遍历当前目录下的文件,用去掉文件后缀的字符串替换文件中的文本
- shell 替换文件中的某一字符串
- Shell脚本运行hive语句 | hive以日期建立分区表 | linux schedule程序 | sed替换文件字符串 | shell推断hdfs文件文件夹是否存在
- shell 脚本替换文件中某个字符串
- shell 脚本替换文件中某个字符串
- shell 批量替换多个文件中字符串
- linux下用shell、sed批量替换多个文件中的字符串
- shell 脚本替换文件中某个字符串
- shell脚本:以一定规律替换某个目录下某些文件中的某个字符串