首页 笔记 图片 查字 
所属分类:Linux
浏览:130
内容:

方法一:

[root@local] vim test1.sh 

#!/bin/bash

while read line

do

  echo "${line} "

done < textfile.log 


方法二:

[root@local] vim test2.sh 

#!/bin/bash

cat textfile.log | while read line

do

  echo "${line} "

done


方法三:

[root@local] vim test3.sh 

#!/bin/bash

cat textfile.log | awk '{print "line: "$0}'