How to display last command that failed when using bash set -e?

后端 未结 5 1304
花落未央
花落未央 2021-02-04 03:51

I am using set -e to stop execution of a script on first error.

The problem is that this does not tell me what went wrong.

How can update a bash scr

5条回答
  •  日久生厌
    2021-02-04 04:15

    set -ex will show (all) lines as they are executed and stop at the first command returning nonzero (not as part of if/while/until constructs).

提交回复
热议问题