[CentOS] Getting the return value of the last command run
Robert Nichols
rnicholsNOSPAM at comcast.netTue May 31 01:24:53 UTC 2011
- Previous message: [CentOS] Getting the return value of the last command run
- Next message: [CentOS] BIND9 - automatic zone definition replication to slave
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 05/30/2011 05:14 PM, fred smith wrote: > Yes, all commands return a value UNLESS it was written by one of the > idi,... er, misguided programmers who thinks its ok to write (in > C): > > void main (void) > { > ... > exit(); > } > > because, of course, in C main() always returns SOMETHING. > > I'm sure it's the same in a bash script, even if the script doesn't > explicitly provide a return value I imagine the shell returns something > anyway, it's just that it's meaningless when that happens. In a bash script, "exit" with no parameter and just falling off the end of the script are both equivalent to "exit $?" and return the status from the last command or shell construct executed in the script. -- Bob Nichols "NOSPAM" is really part of my email address. Do NOT delete it.
- Previous message: [CentOS] Getting the return value of the last command run
- Next message: [CentOS] BIND9 - automatic zone definition replication to slave
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list