Skip to content

How to get the status of the last command? #47

Answered by mwgamera
oliwer asked this question in Q&A
Discussion options

You must be logged in to vote

It's not as obvious as it should be, but putting something along the lines of the following into ~/.esrc should save the result of each command as the global $status variable in login shells:

noexport = $noexport status
fn %eval-noprint { status = <=$* }
fn %eval-print { echo $* >[1=2]; status = <=$* }

I you want it in non-login interactive shell, then I'm afraid it might require modifying initial.es and recompiling. (cf. #33)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@oliwer
Comment options

Answer selected by oliwer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants