运维网's Archiver
论坛
›
Shell/Powershell
› shell notebook
殇帝刘玢你
发表于 2018-8-21 10:35:48
shell notebook
for h in (00..23) 可以设置 00开始
LINE=sed -n '/from=/p' test.txt|sed -n '/to=/p'|sed 's//\)/g'| sed -n '/'"$time"'/p'|`sed 's//\)/g'`
sed 中使用变量需要使用单引号 括着双引号
这样赋值过程中,如果每行中存在空格 就会出现问题 ; 可以使用sed -i '/s/ //g' test.txt 预处理
页:
[1]
查看完整版本:
shell notebook