shell脚本的参数设计,以及shell数组使用 demo
来源:互联网 发布:live for speed mac 编辑:程序博客网 时间:2024/06/05 04:33
文件名:puppet.sh
#使用方法示例:sh puppet.sh --host=90 --host=root@88.88.88.88 --host=55.22.22.12 parm=$*; #接收--host的所有参数 hosts=(); i=0; for p in $parm do if [[ $p == --host* ]]; then host=`echo ${p//'--host='/''}`; hosts[$i]=$host; let "i+=1"; fi done #执行 for h in ${hosts[*]} do echo 'doing.........'$h; if [ $h = "90" ]; then ssh root@101.200.xx.xx "puppet agent -tv --server serverdev126" elif [ $h = "47" ]; then ssh root@101.200.xx.xx "puppet agent -tv --server serverdev126" elif [ $h = "142" ]; then ssh root@101.201.xx.xx "puppet agent -tv --server serverdev126" else ssh $h "puppet agent -tv --server serverdev126" fi done
0 0
- shell脚本的参数设计,以及shell数组使用 demo
- shell脚本的参数
- shell脚本:访问shell脚本的参数
- shell脚本 关联数组的使用
- shell脚本中数组的使用
- shell脚本中数组的使用
- Shell 中mysql 查询以及shell字符串数组的使用
- shell 脚本的使用
- 脚本shell的使用
- shell脚本的使用
- shell脚本的参数问题
- Shell脚本的一些参数
- Shell脚本的参数传递
- Shell脚本Demo
- shell脚本基础demo
- Shell之传递脚本参数与数组
- Shell脚本循环和运算的Demo
- Shell使用笔记-遍历取脚本外部传入的参数
- 运维团队能从橄榄球教练身上学到什么(节选)
- 注解机制及其原理
- 理解c语言中的void*用法
- hbase学习笔记
- Dalvik(达尔维克)和ART的区别
- shell脚本的参数设计,以及shell数组使用 demo
- 中文分词原理和实现
- 首记
- Coin Change
- Android TransitionDrawable ImageView过度效果使用实例
- 预示敏捷方法走偏的15个标志——第2部分
- Java中的自动装箱与拆箱
- Arduino ide 1.6.9 遇到的问题 error: 'TKD2' was not declared in this scope
- 神经语言程序学的十二条前提假设