aboutsummaryrefslogtreecommitdiffstats
path: root/tools/check-shebang.sh
diff options
context:
space:
mode:
authorAndrew Donnellan <ajd@linux.ibm.com>2025-12-10 13:43:04 +1100
committerAleksandr Nogikh <nogikh@google.com>2025-12-10 05:39:31 +0000
commit5b5f646079e8abe6d9b1f550aaf0e837b2f5ea13 (patch)
tree0fc36fe75b4fc936f26624daab539bc60c5f4812 /tools/check-shebang.sh
parent6309de2073070b3516f0e786221f116238423d31 (diff)
all: replace egrep with grep -E
The egrep command has been deprecated in GNU Grep since 2007, and nowadays using egrep rather than grep -E will print a warning to the user, which is very annoying. Replace all usages of egrep with grep -E. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Diffstat (limited to 'tools/check-shebang.sh')
-rwxr-xr-xtools/check-shebang.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/check-shebang.sh b/tools/check-shebang.sh
index 368e03b64..9c211eb7b 100755
--- a/tools/check-shebang.sh
+++ b/tools/check-shebang.sh
@@ -4,9 +4,9 @@
FAILED=""
FILES=0
-for F in $(find . -perm -u=x -type f | egrep -v "/gen/|/.git"); do
+for F in $(find . -perm -u=x -type f | grep -E -v "/gen/|/.git"); do
((FILES+=1))
- if head -n 1 "$F" | egrep -q '^#!/' && head -n 1 "$F" | egrep -v -q -e '^#!/bin/sh$' -e '^#!/usr/bin/env '; then
+ if head -n 1 "$F" | grep -E -q '^#!/' && head -n 1 "$F" | grep -E -v -q -e '^#!/bin/sh$' -e '^#!/usr/bin/env '; then
echo "$F: Non-portable shebang line. Please use /usr/bin/env to locate the interpreter."
FAILED=1
fi