Linux下shell脚本编写:常用命令
2016-11-04 15:54
811 查看
1.创建软连接
将test1文件拷贝至test2文件下
若文件名存在空格或者.等特殊字符
则访问该文件时,使用\ \隔开,例如
文件a所在路径为
脚本名称为test.sh
comproject=/home/test #建立软链接 cd $comproject/src/ rm -rf ipsfe ln -s $ipsfe ipsfe2.删除文件
rm $comproject/src -rf3.拷贝文件
将test1文件拷贝至test2文件下
cp $comproject/test1 $comproject/test2/ -rf4.执行.sh文件
SZX1000058409:/home/compileprj/autoscript # sh copy.sh FSPV3R2C705.特殊文件的处理
若文件名存在空格或者.等特殊字符
则访问该文件时,使用\ \隔开,例如
文件a所在路径为
SZX1000058409:/home/test/1 IP LIB/1.00 Head Files/则在shell脚本中,该路径书写为:
/home/test/\1\ IP\ LIB\/\1.\0\0\ Head\ Files\/a5.脚本中设置参数
脚本名称为test.sh
if [ $1 == "root1" ] then m=m_1 v=v_1 elif [ $1 == "root2" ] then m=m_2 v=v_2 else echo "This Version is not exist, please check out." exit 0 fi在执行脚本时则为
./test.sh root1 ./test.sh root2
相关文章推荐
- Linux(7) 常用命令扩展 改变用户环境变量 (可以实现登陆就执行shell脚本)
- 【shell脚本开发技术】linux中shell script脚本开发编程常用命令与脚本速记指南
- 脚本的编写和Linux下常用的命令
- Linux新手生存笔记[10]——shell脚本基础3-函数及常用命令
- linux学习笔记(20) - shell脚本编写常用判断命令
- 常用linux命令及shell脚本
- [置顶] linux常用命令与shell脚本编程
- linux常用命令 和shell脚本(必知)
- Linux新手生存笔记[10]——shell脚本基础3-函数及常用命令
- Linux新手生存笔记[10]——shell脚本基础3-函数及常用命令
- 常用linux系统命令及简单小脚本
- linux 常用脚本、命令
- [zt] Linux&Shell 常用命令
- 在linux中常用的shell备份脚本
- linux中常用shell命令收集
- linux常用的脚本、命令
- Linux脚本Shell命令
- Linux下常用命令和脚本备忘
- 自己编写的一个查找Linux进程的Shell脚本
- Linux常用shell脚本