Shell script read missing last line

前端 未结 7 1158
逝去的感伤
逝去的感伤 2020-11-22 12:57

I have an ... odd issue with a bash shell script that I was hoping to get some insight on.

My team is working on a script that iterates through lines in a file and

7条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 13:28

    As a workaround, before reading from the text file a newline can be appended to the file.

    echo "\n" >> $file_path
    

    This will ensure that all the lines that was previously in the file will be read.

提交回复
热议问题