linux shell 随笔

时间:2021-07-11 11:28:09   收藏:0   阅读:22

1、shell 中的for循环

#!/bin/bash
item=0

for file in `find /record01/vod/*.ts -type f|egrep -v ‘source|k.ts|test|lison|LISON‘`
do
       let item+=1
       echo $item
       echo $file      
done

2、shell 中的字符串拼接

#!/bin/bash
name="Shell"
url="http://c.biancheng.net/shell/"
str1=$name$url  #中间不能有空格
str2="$name $url"  #如果被双引号包围,那么中间可以有空格
str3=$name": "$url  #中间可以出现别的字符串
str4="$name: $url"  #这样写也可以
str5="${name}Script: ${url}index.html"  #这个时候需要给变量名加上大括号

3、

?

原文:https://blog.51cto.com/u_11005805/3034859

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!