Shell script while read line loop stops after the first line

后端 未结 4 781
遇见更好的自我
遇见更好的自我 2020-11-21 23:52

I have the following shell script. The purpose is to loop thru each line of the target file (whose path is the input parameter to the script) and do work against each line.

4条回答
  •  心在旅途
    2020-11-22 00:43

    This was happening to me because I had set -e and a grep in a loop was returning with no output (which gives a non-zero error code).

提交回复
热议问题