eisai on Nostr: menherahair If that thing is to be sourced why in the world does it have a shebang, ...
menherahair (npub1n78…87ev) If that thing is to be sourced why in the world does it have a shebang, aaaaaa
Yeah, I agree, that it’s a bad idea to barge in with your stuff in the middle of works. And the reason why “set -e” didn’t work is difficult to figure out without seeing the description of die() and the shell options in the initial script, but some reasons may be speculated about:
- using ${var:-another_var} removes the possibility to catch an error here, as the “:-” operator is made exactly to avoid an empty variable triggering an error. A substitution to a string that happens to also be empty doesn’t count as an error (since instead of using a potentially empty value you use substitution, hence you must know what you’re doing)
- the “[[ -z "$*" ]] && die …” construction relies on “die” to perform exit with the “bad” code, since the logical expressions (&&, ||…) lift up the restriction imposed by “set -e”.
Which means that the pipefail never works, because inside the subshell (which is on the left side of the pipe) there’s never an error – thanks to ${…:-…} – and the check on the empty list of arguments (-z "$*") in _eval_user_sequence() is futile because of the logic expression (&&). The die() function should be doing the exit in this situation, but apparently, it cannot?
Published at
2024-03-24 15:36:10Event JSON
{
"id": "8273870f67ad2f27f9d52832dbf693ca31f19309f9b5ea83974469774eb8e38c",
"pubkey": "8cd20c7236dac2fcfd775e1a189f54e7183dc65f22df1c6445cfe0dfe7ad6df5",
"created_at": 1711294570,
"kind": 1,
"tags": [
[
"p",
"9f8f12d3dbef548f0c2d23696999eeba508ffdd08c71f01408ab7798bbbc30d8",
"wss://relay.mostr.pub"
],
[
"e",
"b4a0ee21d4ead3d278190af184e0e4f078679e1f33538edd6278e5ce38674a8c",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://eientei.org/objects/dfa25e92-df7c-4995-8cbd-68a7b10d7561",
"activitypub"
]
],
"content": "nostr:npub1n783957maa2g7rpdyd5knx0whfggllws33clq9qg4dme3wauxrvq6q87ev If that thing is to be sourced why in the world does it have a shebang, aaaaaa\n\nYeah, I agree, that it’s a bad idea to barge in with your stuff in the middle of works. And the reason why “set -e” didn’t work is difficult to figure out without seeing the description of die() and the shell options in the initial script, but some reasons may be speculated about:\n - using ${var:-another_var} removes the possibility to catch an error here, as the “:-” operator is made exactly to avoid an empty variable triggering an error. A substitution to a string that happens to also be empty doesn’t count as an error (since instead of using a potentially empty value you use substitution, hence you must know what you’re doing)\n - the “[[ -z \"$*\" ]] \u0026\u0026 die …” construction relies on “die” to perform exit with the “bad” code, since the logical expressions (\u0026\u0026, ||…) lift up the restriction imposed by “set -e”.\n\nWhich means that the pipefail never works, because inside the subshell (which is on the left side of the pipe) there’s never an error – thanks to ${…:-…} – and the check on the empty list of arguments (-z \"$*\") in _eval_user_sequence() is futile because of the logic expression (\u0026\u0026). The die() function should be doing the exit in this situation, but apparently, it cannot?\n\nhttps://eientei.org/media/783586c33576efcebb866e908eafc58aa729341b671dd6ddfdffe8925d9dc3f6.jpg?name=chopper%20argument.1.jpg",
"sig": "4fbf14627f77ba6d8360413d3b3f833c4898243b955015837e6a286bb1901c56429c5754ef6f4a9b70861eb9846ed9178865b9c1ae3b166ae5920e29d87edb96"
}