aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc
diff options
context:
space:
mode:
authorDan Cross <cross@gajendra.net>2025-07-22 14:42:03 +0000
committerDan Cross <cross@gajendra.net>2025-07-23 19:44:54 +0000
commit564d45b5a55adeb48f69fdecb2bf4ed1f909850b (patch)
treec1aefa9b2ff41e1d49a5cdba1d2a098e300cc76f /src/cmd/rc
parent28690cd427d3caacc50f3df6a3ee901eba5c5dd0 (diff)
config: add $egrep
Introduce a new variable set in $PLAN9/config: $egrep, which is conditionally set to either `egrep` or `grep -E`, based on platform, and use this when we want to invoke `egrep`. This works around the endless warnings from GNU grep stating that `egrep` is deprecated in favor of `grep -E`, when run on e.g. Linux.
Diffstat (limited to 'src/cmd/rc')
-rwxr-xr-xsrc/cmd/rc/checkparse10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cmd/rc/checkparse b/src/cmd/rc/checkparse
index 0a1472b2..4ddd0910 100755
--- a/src/cmd/rc/checkparse
+++ b/src/cmd/rc/checkparse
@@ -1,5 +1,13 @@
#!/bin/bash
+egrep=egrep
+tag="${SYSNAME:-`uname`}"
+case "$tag" in
+*Linux*)
+ egrep='grep -E'
+ ;;
+esac
+
aflag=false
if [ "$1" = -a ]; then
aflag=true
@@ -10,7 +18,7 @@ files="$@"
if [ $# = 0 ]; then
files=$(echo ./test.rc;
grep -l '^#!/usr/local/plan9/bin/rc' /usr/local/plan9/bin/{*,*/*} 2>/dev/null;
- grep -R -l '^#!/bin/rc' $HOME/pub/plan9 | egrep -v 'plan9/(lib/(oui|pci)|sys/man|sys/lib/man|sys/lib/scsicodes)' 2>/dev/null)
+ grep -R -l '^#!/bin/rc' $HOME/pub/plan9 | $egrep -v 'plan9/(lib/(oui|pci)|sys/man|sys/lib/man|sys/lib/scsicodes)' 2>/dev/null)
fi
for i in $files