logoalt Hacker News

cassianolealyesterday at 11:28 PM1 replyview on HN

I had some shell scripts littered with `|| true`, which was obviously obscuring real errors everywhere. When I challenged the model, it gave me the same "cargo-culting" answer.


Replies

bewuethrtoday at 2:32 AM

The `|| true` is often done because people use `errexit` as part of "Bash strict mode"[1], which comes with so many caveats[2] that I usually avoid it. Claude, however, loves it.

[1]: http://redsymbol.net/articles/unofficial-bash-strict-mode/

[2]: https://mywiki.wooledge.org/BashPitfalls#set_-euo_pipefail