> Date: Fri, 04 Nov 2005 16:53:03 -0500 > From: Charles Levert <[EMAIL PROTECTED]> > Subject: Re: grep . /; echo $? > To: bug-grep@gnu.org > > ..... This would go well with > my proposal to track the kind of error (i.e., > which system call) with a bit-flag in the exit > code as well.
My two cents: this isn't worth the trouble. I've written lots of shell scripts in my life, and typically all one really wants to know is success/failure: if grep pattern file > /dev/null then ... else ... fi Not to mention that extracting bits from the exit value in a shell script is, shall we understate it, painful. My suggestion is to K.I.S.S.: EXIT CODE 0 - found at least one match 1 - found no matches at all 2 - something went wrong Arnold