Shell scripts are several ways to read the file rows

1.

#! / bin / bash 
the while the Read Line 
do 
echo $ Line 
DONE <filename (file to be read)

2.

! # / bin / bash 
CAT filename (file to be read) | the while the Read Line 
do 
echo $ Line 
DONE

3.

for line in `cat filename (file to be read)` 
do 
echo $ Line 
DONE

  

 

Guess you like

Origin www.cnblogs.com/lovemakee/p/10930371.html