Use Bash to read line by line and keep space

后端 未结 6 888
感情败类
感情败类 2020-11-28 05:00

When I use \"cat test.file\", it will show

1
 2
  3
   4

When I use the Bash file,

cat test.file |
while read data
do
    e         


        
6条回答
  •  清歌不尽
    2020-11-28 05:20

    Alternatively, use a good file parsing tool, like AWK:

    awk '{
      # Do your stuff
      print 
    }' file
    

提交回复
热议问题