Unnofficial KISS Linux community channel | https://kisscommunity.bvnf.space | post logs or else | song of the day https://vid.puffyan.us/H7PvgY65OxA
Earlier messages
pbsdsquit (Ping timeout: 268 seconds)
pbsds8changed nick to pbsds
<testuser[m]>why does this work https://termbin.com/tgsh
<testuser[m]>but not this https://termbin.com/m57h
yamchah2quit (Remote host closed the connection)
seregquit (Max SendQ exceeded)
<testuser[m]>the problem happens when u short circuit the outermost subshell
<wael[m]>i believe it happens since there is `||` at the end of the recent subshell the outermost subshell's error is ignored
<wael[m]>since `-e` flag is set
<testuser[m]>but the code after || doesnt even get executed
<testuser[m]>for some reason
<testuser[m]>it should
<wael[m]>https://termbin.com/m57h ?
<testuser[m]>exit 1 isnt executed
<wael[m]>because it exits on error without an error handler
<testuser[m]>it doesnt cuz the lowermost unreachable is printed
<testuser[m]>this is with set -eu
<wael[m]>the last command in the list hasnt returned with non-zero
<wael[m]>so its seen as 'non-error' since its subshell
<testuser[m]>the behaviour doesntmake sense
<testuser[m]>but its true
<wael[m]>try it with symbol { }
<phoebos>set -e and || don't play well together
<phoebos>i don't understand it tbh
<testuser[m]>SO BAD
<wael[m]>last time i seen shell scripting be confusing is when i got seg fault
<testuser[m]>well i just added || return $? after all the sub-subshells
<testuser[m]>seems to work
<phoebos>i'm not sure why the exit doesn't run but the false doesn't cause it to exit because it's in an AND-OR list
<phoebos>ie. a command failing is always permitted in that context
<phoebos>so the false is permitted
<phoebos>then the second echo is run
<phoebos>which is successful, so the exit 1 doesn't run
<phoebos>get rid of echo unreachable and exit 1 runs
rohanquit (Ping timeout: 265 seconds)
Later messages