随笔分类 -  [技术]Shell

摘要:转自:http://www.360doc.com/content/13/0513/20/9437165_285204629.shtml ${parameter} 取parameter的值 ${parameter:-word} 如果parameter为空,则用word的值做parameter的缺省值 ${parameter:=word} 在2的基础上,把word的值赋给pa... 阅读全文
posted @ 2016-12-23 15:03 dorothychai 阅读(348) 评论(0) 推荐(0) 编辑
摘要:转自:http://smilejay.com/2011/12/bash_ifs/ 在bash中IFS是内部的域分隔符,manual中对其的叙述如下: IFS The Internal Field Separator that is used for word splitting after expansion and to split lines into words with the r... 阅读全文
posted @ 2016-12-23 14:52 dorothychai 阅读(6748) 评论(0) 推荐(0) 编辑
摘要:转自:http://blog.csdn.net/xuhongning/article/details/61915151,参数替换:不含有“:”的,只要定义了,就生效,不管是否为空含有“:”的,即使定义了,但是为空就不生效用来替换的内容可以是字符串、一个变量、命令的输出被替换的内容是变量,如$a、$1... 阅读全文
posted @ 2015-05-08 23:29 dorothychai 阅读(215) 评论(0) 推荐(0) 编辑
摘要:1. 循环遍历所有节点 #!/bin/bash IpPrefix=192.168.1. User=root Pwd=000000 for((i=84;i> tmp/$i echo "$i done!" }& done 2. 拷贝文件到所有节点 #!/usr/local/bin/expect -f set timeout -1 set IpAddr [li... 阅读全文
posted @ 2015-05-08 12:54 dorothychai 阅读(458) 评论(0) 推荐(0) 编辑
摘要:写了一个自动安装和配置FastDFS的脚本,还没有写好关于nginx的配置。先贴上,如下:自动安装FastDFS,(这部分是之前同事写好的)#!/bin/bash#instll gccecho "================== install gcc ===============... 阅读全文
posted @ 2015-04-01 18:01 dorothychai 阅读(502) 评论(0) 推荐(0) 编辑
摘要:#!/usr/local/bin/expect -f set timeout -1 set UFEIpAddr “” set User “” set UFEPwd "" set UFEDBPwd "" set SMNIpAddr "" set SMNPwd "" set SMNDBPwd "" spawn ssh $User@$UFEIpAddr expect { ... 阅读全文
posted @ 2015-03-31 19:06 dorothychai 阅读(208) 评论(0) 推荐(0) 编辑
摘要:近期在别人的工作基础上完善了几个shell自动安装脚本。 1. 循环远程访问机器并安装 #!/bin/bash IpPrefix=52.1.123. User=root Pwd=11111111 SMNIP=52.1.123.79 for((i=84;i<100;i++)) do echo $IpPrefix$i ./remote.exp $IpPre... 阅读全文
posted @ 2015-03-29 14:29 dorothychai 阅读(229) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示