美文网首页
shell 读取文件

shell 读取文件

作者: cain07 | 来源:发表于2020-08-11 14:23 被阅读0次
list=`cat $1`
for val in $list
do
   echo $val
done
while read line
do
    echo $line
done < test.txt
  1. 查找文件内容 并赋值变量
a=`grep -i 'versions_ent.environment=' $1`; 

for val in $a
do
        echo "grep->"$val
done

相关文章

网友评论

      本文标题:shell 读取文件

      本文链接:https://www.haomeiwen.com/subject/ehajrktx.html