while read file

While the method of reading the file, the summary record is as follows

1: The way of the pipeline

cat /tmp/a.log |while read LINE
do
    echo $LINE
done

 2: The way of redirection

while read LINE
do
     echo $LINE
done < /tmp/a.log

 3: File descriptor method

exec </tmp/a.log

while read line
do
    echo $line
done

 4: The second method is the fastest through Baidu.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326763217&siteId=291194637