On Mon, Jul 2, 2012 at 5:02 PM, Janis Papanagnou <
[email protected]> wrote:

>
> > My purpose is to pass the $? value (unchanged) from the wrapper
> > function "runcmd" to its caller so the caller can tell if the command
> > exited normally or it was killed by a signal.
>
> In the general case passing values "unchanged" is not possible since in
> the exit code context you have a limited "bandwidth" of 8 bit (0..255).
> So you will have to map exit codes and signals onto that available range
> if you want to pass both through that single exit code channel.
>
> Mind that bash can also pass just 256 values through the exit code. So
> if all you want is to imitate bash behaviour (or ksh88 behaviour) the
> subtraction of 128, as previously proposed, may fit your needs.
>
> I may use a global var to save the $? value between functions.
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to