While loop stops reading after the first line in Bash

后端 未结 4 869
温柔的废话
温柔的废话 2021-01-20 21:13

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条回答
  •  北荒
    北荒 (楼主)
    2021-01-20 22:07

    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).

提交回复
热议问题