Exit code 252

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Thu Mar 21 00:23:35 AEST 1991


In article <527 at bria> uunet!bria!mike writes:
> In an article, kramden.acf.nyu.edu!brnstnd (Dan Bernstein) writes:
> >[...] New users seem to notice this most often in Makefiles and
> >when a job exits in the background under csh; otherwise the exit code of
> >such programs generally isn't used.
> Ahem -- I beg your pardon.  The exit code of a *majority* of the programs
> on UNIX *are* used.  Otherwise ``||'', ``&&'', ``$?'' and ``if'' would be
> somewhat worthless, now wouldn't they? :-)

I said ``such programs,'' those being the programs that don't return a
meaningful exit code. Example: echo. Sure, echo is useful in Makefiles,
and you might occasionally run it in the background in csh; but I've
never seen anyone test its exit code in scripts. If it didn't exit(0),
new users would notice that fact in Makefiles or when a job exits in the
background, as I said.

---Dan



More information about the Comp.lang.c mailing list