-
Bug
-
Resolution: Fixed
-
P5
-
1.4.0
-
None
-
rc1
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2040631 | 1.4.0 | Dale Mcduffie | P5 | Resolved | Fixed | beta |
Name: dm26566 Date: 02/09/2001
There are a series of checks for validting the contents of MAKEFLAGS. They
could be simplified:
To check if $MAKEFLAGS contains a space-delimited 'e' or 'i' or 'I' (you
can generalize from there):
echo "$MAKEFLAGS" | egrep -c '(^| )[eiI]( |$)'
^^^ matches start of line or a space
^^^ space or end of line
The "-c" flag causes egrep to return a count of the number of matching
lines on stdout. It'll be 0 if nothing matches, so:
if [ `echo ...` -ne 0 ]; then echo Bad boy; fi
egrep has an option to supress the output, which is useful for
conditional tests in shell scripts. /bin/egrep uses "-s" while
GNU egrep uses "-q". So you could use this, but you'd need to
be careful in a multi-platform script to see who uses what.
======================================================================
- backported by
-
JDK-2040631 sanityck testing of makefile flags could be simplified
-
- Resolved
-