[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep . /; echo $?
From: |
Aharon Robbins |
Subject: |
Re: grep . /; echo $? |
Date: |
Wed, 09 Nov 2005 21:12:52 +0200 |
> Date: Fri, 04 Nov 2005 16:53:03 -0500
> From: Charles Levert <address@hidden>
> Subject: Re: grep . /; echo $?
> To: address@hidden
>
> ..... 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
- Re: grep . /; echo $?, (continued)
- Re: grep . /; echo $?, Andreas Schwab, 2005/11/04
- Re: grep . /; echo $?, Julian Foad, 2005/11/04
- Re: grep . /; echo $?, Charles Levert, 2005/11/04
- Re: grep . /; echo $?, Julian Foad, 2005/11/08
- Exit statuses and errors messages (was Re: grep . /; echo $?), Charles Levert, 2005/11/08
- Re: Exit statuses and errors messages (was Re: grep . /; echo $?), Charles Levert, 2005/11/08
- Re: Exit statuses and errors messages (was Re: grep . /; echo $?), Julian Foad, 2005/11/09
- Re: grep . /; echo $?, Benno Schulenberg, 2005/11/04
- Re: grep . /; echo $?, Charles Levert, 2005/11/04
- Re: grep . /; echo $?, Julian Foad, 2005/11/04
Re: grep . /; echo $?,
Aharon Robbins <=