It's really easy to have main() return 0 or 1 on error... but more important than returning an error code is returning a *meaningful* error code. Perhaps we could assemble a list of errors and set up a header file with some defines (and errors texts!) so that scripts such as yours can be used even more effectively.
A little list... Error 0: no errors, duh! Error 1: something is buggered, but not sure what Error 2: bad command line Error 3: cannot connect to database Error 4: cannot connect to authentication Error 5: ... Aaron On Sun, 20 Apr 2003, Jacques Beaudoin wrote: > I use dbmail-adduser and dbmail-maintenance in bash scripts via the > webmin interface. > > I get this way a easy to use web administration tool for dbmail. > > If dbmail-adduser and dbmail-maintenance could return a execution code > (errorlevel). > > I could use the bash "if command" to check if dbmail-adduser or > dbmail-maintenance executed with no errors. > > Exemple dbmail-adduser ................: > if [$? != 0]; then > ........ > else > ......... > fi > > Could this be added to dbmail-adduser and dbmail-maintenance > > Thanks > Jacques > > _______________________________________________ > Dbmail mailing list > [email protected] > https://mailman.fastxs.nl/mailman/listinfo/dbmail >
