Reputation
777
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
2 8 24
Impact
~57k people reached

Apr
27
awarded  Notable Question
Apr
18
awarded  Famous Question
Apr
9
awarded  Famous Question
Jan
29
awarded  Nice Question
Jan
29
awarded  Yearling
Jan
11
accepted Save exit code for later
Jan
11
comment Save exit code for later
So with your update I would have to initialize last_error_code to zero and then return at the end so I would have non-zero exit code if any command threw an error? It is a cool trick, but for my two line hack script, I think I prefer @mikeserv 's answer.
Jan
11
comment Save exit code for later
Ah I agree it's better than my original. But it still feels unsatisfactory that I have to explicitly store the exit code to a variable. Is there no way to 'push' an exit code and 'pop' it again later?
Jan
11
asked Save exit code for later
Sep
27
awarded  Notable Question
Sep
20
awarded  Popular Question
Sep
7
awarded  Nice Question
Aug
15
awarded  Popular Question
Aug
6
awarded  Notable Question
Jul
29
awarded  Popular Question
Jul
2
awarded  Curious
Jun
9
awarded  Caucus
Jun
1
awarded  Popular Question
Apr
5
accepted what does `sshfs -oworkaround=rename` do?
Apr
5
asked what does `sshfs -oworkaround=rename` do?