[Tfug] Problem checking return code in bash script

Chad Woolley thewoolleyman at gmail.com
Tue Oct 6 09:35:16 MST 2009


On Tue, Oct 6, 2009 at 1:57 AM, Choprboy <choprboy at dakotacom.net> wrote:
> Your program is testing the exit status of the command you gave, i.e.
> the "sudo". The sudo suceeded... it was the sudo'd command that failed. The
> sudo creates a subshell, and the su also creates a subshell, so your are
> really 3 subshells down when executing ruby. The upper shell completed
> successfully.

Thanks for explaining.  Is there no way to make sudo and su bubble up
the return code?




More information about the tfug mailing list