shell-array

[b]shell 中的数组[/b]

tomcat_ow="name password job school"
tomcat_ow_array=($tomcat_ow)
${tomcat_ow_array[1]}


[b]变量赋值[/b]

var=`cat help.txt`
echo $var

输出:
#保险例子 ./grepLog.sh "ins" "grep Exception -A20 -B20 /home/q/www/ttsins.***.com/logs/vendor.log.2013-09-11-16" #搜索 ./grepLog.sh "tts_is" "zegrep ZLIB /server/tts/logs/tts.log.2013-09-26-13.gz" #常规机器 ./grepLog.sh "ttsi" "zegrep ZLIB /server/tts/logs/tts.log.2013-09-26-11.gz" #TTM ./grepLog.sh "ttm" "zegrep ZLIB /server/tts/logs/tts.log.2013-09-26-11.gz" #JOB ./grepLog.sh "job" "zegrep ZLIB /server/tts/logs/tts.log.2013-09-26-11.gz" #avfeedback ./grepLog.sh "avfeed" "zegrep ZLIB /server/tomcat/logs/tts.log.2013-09-26-11.gz" #router ./grepLog.sh "router" "grep Exception /home/q/www/router/logs/search.log" #task ./grepLog.sh "task" "grep Exception /server/tts/logs/tts.log.2013-09-26-11.gz" #work ./grepLog.sh "work" "grep Exception /home/q/www/ttssearch/logs/dubbo-access-2013-12-03.log"



var=$(cat help.txt)
echo $var

输出:
#保险例子 ./grepLog.sh "ins" "grep Exception -A20 -B20 /home/q/www/ttsins.***.com/logs/vendor.log.2013-09-11-16" #搜索 ./grepLog.sh "tts_is" "zegrep ZLIB /server/tts/logs/tts.log.2013-09-26-13.gz" #常规机器 ./grepLog.sh "ttsi" "zegrep ZLIB /server/tts/logs/tts.log.2013-09-26-11.gz" #TTM ./grepLog.sh "ttm" "zegrep ZLIB /server/tts/logs/tts.log.2013-09-26-11.gz" #JOB ./grepLog.sh "job" "zegrep ZLIB /server/tts/logs/tts.log.2013-09-26-11.gz" #avfeedback ./grepLog.sh "avfeed" "zegrep ZLIB /server/tomcat/logs/tts.log.2013-09-26-11.gz" #router ./grepLog.sh "router" "grep Exception /home/q/www/router/logs/search.log" #task ./grepLog.sh "task" "grep Exception /server/tts/logs/tts.log.2013-09-26-11.gz" #work ./grepLog.sh "work" "grep Exception /home/q/www/ttssearch/logs/dubbo-access-2013-12-03.log"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值