Hi,

A script I'm working on needs access to the exit code of the last foregrounded 
command.
I thought I had the idea with something like this:

#!/command/execlineb
foreground { exit 122 }
import LASTEXITCODE
echo $LASTEXITCODE


This just prints a blank line. What part of the concept am I missing here?
The documentation seems clear enough, but perhaps I'm being obtuse.
At one point I wondered if LASTEXITCODE was getting set, but after reading
through foreground.c, el_execsequence.c, pathexe_r_name.c, and env_merge.c,
it seems to me that it is being added to the env.

Thanks in advance for any help or clarification.
John

Reply via email to