shell script
来源:互联网 发布:淘宝零食店一箱零食 编辑:程序博客网 时间:2024/05/06 20:00
比较健忘,有用的shell脚本贴过来,以便下次参考
1.将某个文件夹下的所有以.h和.c结尾的文件中的aaa替换为bbb
#!/bin/bash
find ../ -name '*.h' -print0 |xargs -0 sed -i 's/aaa/bbb/g'
find ../ -name '*.c' -print0 |xargs -0 sed -i 's/aaa/bbb/g'
2.将某个文件夹下指定的一些文件对应的copy到另外一个目录
#!/bin/bash
src="src_dir"
des="des_dir"
files="Makefile a/a.h b/b.c"
#copy files
echo "-----------------copy files---------------------"
for i in $files;
do
if cp $src/$i $des/$i
then echo "success copy $i destination"
else echo "can not copy $src/$i to $des/$i"
fi
done
- shell Script
- shell script
- Shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- Shell Script
- shell script
- shell script
- shell script
- shell script
- shell script
- Shell Script
- COS简介
- 编程珠玑 Column 1
- svn: Can't open file '/var/www/svn/experience/db/txn-current-lock': Permission denied
- 静态绑定 动态绑定
- 据说看完这21个故事的人,30岁前都成了亿万富翁。你是下一个吗?
- shell script
- ASCII与中文的相互转换
- 数据库 SQL not in
- 思考
- Java学习笔记 2011.06.22
- jsp连接数据库大全
- develop.newLifeGroup.com.cn
- 一个简易画板的实现(Graphics View)
- 英特尔软交会展示MeeGo平板 中国大陆已可预订