On Tue, 2 Aug 2011, Ritesh Raj Sarraf wrote: > On 07/28/2011 04:10 AM, Ritesh Raj Sarraf wrote: > > On 07/28/2011 02:57 AM, Eric Belanger wrote: > >> > That would work but I'm not sure if the shell will interpret > >> > the return value as being for the script rather than for the > >> > function itself. How about replacing 'return 0' by 'exit 0' ? > >> > That seems to be better suited for the situation as we are > >> > exiting the script at that point. And it is accepted by bash. > > Great. Thanks. I'll test it out > I think I'll go with exit 0. Line #1089 in 1.58 laptop-mode script > already did exit 0 gracefully.
I just can't get what the magic with that 'exit 0' is, other than fooling the user into thinking everything went just fine. > For now, please use exit 0 and report back if it causes any other > problems. Or just don't use anything. And this is why: http://pubs.opengroup.org/onlinepubs/009695399/utilities/sh.html EXIT STATUS The following exit values shall be returned: ... Otherwise, the shell shall return the exit status of the last command it invoked or attempted to invoke (see also the exit utility in Special Built-In Utilities). Cheers, -- Cristian -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org