1 ?RCS: $Id: contains.U 1 2006-08-24 12:32:52Z rmanfredi $
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: $Log: contains.U,v $
12 ?RCS: Revision 3.0 1993/08/18 12:05:35 ram
13 ?RCS: Baseline for dist 3.0 netwide release.
15 ?MAKE:contains: Nothing
16 ?MAKE: -pick add $@ %<
18 ?S: This variable holds the command to do a grep with a proper return
19 ?S: status. On most sane systems it is simply "grep". On insane systems
20 ?S: it is a grep followed by a cat followed by a test. This variable
21 ?S: is primarily for the use of other Configure units.
23 : Some greps do not return status, grrr.
24 echo "grimblepritz" >grimble
25 if grep blurfldyick grimble >/dev/null 2>&1 ; then
27 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
33 : the following should work in any shell
37 echo "AGH! Grep doesn't return a status. Attempting remedial action."
38 cat >contains <<'EOSS'
39 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp