By way of .ike ... the following standard error codes have just been brought to my attention ... pretty sweet<div><br></div><div>/* from head/includes/sysexits.h */</div><div><div>#define EX_USAGE 64 /* command line usage error */</div>
<div>#define EX_DATAERR 65 /* data format error */</div><div>#define EX_NOINPUT 66 /* cannot open input */</div><div>#define EX_NOUSER 67 /* addressee unknown */</div><div>#define EX_NOHOST 68 /* host name unknown */</div>
<div>#define EX_UNAVAILABLE 69 /* service unavailable */</div><div>#define EX_SOFTWARE 70 /* internal software error */</div><div>#define EX_OSERR 71 /* system error (e.g., can't fork) */</div>
<div>#define EX_OSFILE 72 /* critical OS file missing */</div><div>#define EX_CANTCREAT 73 /* can't create (user) output file */</div><div>#define EX_IOERR 74 /* input/output error */</div>
<div>#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */</div><div>#define EX_PROTOCOL 76 /* remote error in protocol */</div><div>#define EX_NOPERM 77 /* permission denied */</div>
<div>#define EX_CONFIG 78 /* configuration error */</div><div><br></div><div>Looks like bin/, usr.bin/ and usr.sbin/ executables all make use of these exit codes correctly, wonder if anyone is doing anything with these, or makes use of this standard in their programs. Only thing missing here is a helper program for sh(1) to determine exit meaningfulness from exit code:</div>
<div><br></div><div>if causedexit $? USAGE DATAERR; then</div><div> # ...</div><div>elif causedexit $? NOUSER NOHOST; then</div><div> # ...</div><div>fi # etc ...</div><div><br></div>-- <br>regards,<br>matt<br>
</div>