J.P. Trosclair wrote:
This is really off topic, but grep already returns a success and
failure code based on if there were any matches which mouss's code
uses from what I can tell. There's really no reason to look at grep's
stdout, if it has a match the return code is 0, it doesn't it's != 0.
$ echo foo | grep -q bar; echo $?
1
$ echo bar | grep -q bar; echo $?
0
Maybe I misunderstood what you're saying.
Yes :D
I wanted to say exactly this - it is quite handy to have a meaningfull
exit-code - like with grep.
And no, creating such wrappers is not realy the same ...
Thanx ...