Re: Getting the return value of the last command run

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Tue, May 31, 2011 at 01:14, fred smith <fredex@xxxxxxxxxxxxxxxxxxxxxx> 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.
>

I also learned in C that main should be an int. Now that I'm studying
Java, main is always a void and nobody has been able to explain to me
why.

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux