shell脚本for实用(不定期更新)
2015-04-30 10:17
246 查看
1、实现sourse目录下部分文件(文件名以文本列表形式列出,文本文件名为list),复制到另外一个目录/opt/targe/下
扩展 scp -P 端口号 root@ip:/opt/source/ /opt/targe/
2、
#!/bin/bash cd /opt/source for file in `cat /opt/source/list` ; do cp -r -n $file /opt/targe/ done注:``在tab键上面 ,cp -n代表不覆盖。
扩展 scp -P 端口号 root@ip:/opt/source/ /opt/targe/
2、
#!/bin/bash for str in 1 2 3 4 5 do echo -e "The value is: $str \n" done输出
The value is: 1 The value is: 2 The value is: 3 The value is: 4 The value is: 5
#!/bin/bash for str in "1 2 3 4 5" do echo -e "The value is: $str \n" done输出
The value is: 1 2 3 4 5
相关文章推荐
- PHP实用的小工具函数,不定期更新
- 【汇总,不定期更新】c++实用的STL
- VIM实用小技巧(不定期更新)
- linux系统里的一些实用命令记录——不定期更新哦!
- 比较实用的几个网站收藏 不定期更新
- Android EditText 各种实用属性——不定期更新
- Bash下的实用小脚本(不定期更新)
- 大家好,我是筱鹏,日后我将会在我的博客不定期更新IOS开发的自定实用小功能
- 分享一些实用的Android Studio插件 - 不定期更新
- 【工具】各种网络工具 相当实用 【不定期更新】
- android 零散笔记不定期更新 v16
- Android之MVC——Model通知View去更新(实用)
- [VisualStudio]_[VS实用插件集合*持续更新]
- 优秀的Web学习网站(不定期更新)
- (2)JDBC (C3P0)大批量数据的插入、更新实用方法。(实战篇)-个人总结
- 关于str__相关操作源码,不定期更新
- 大神养成之路上的经验教训,持续不定期更新ing
- GDAL/OGR C# FAO(不定期更新)
- Shell基础(不定期更新)