From 5b5f646079e8abe6d9b1f550aaf0e837b2f5ea13 Mon Sep 17 00:00:00 2001 From: Andrew Donnellan Date: Wed, 10 Dec 2025 13:43:04 +1100 Subject: 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 --- tools/check-copyright.sh | 6 +++--- tools/check-language.sh | 2 +- tools/check-shebang.sh | 4 ++-- tools/check-whitespace.sh | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tools') diff --git a/tools/check-copyright.sh b/tools/check-copyright.sh index fe88c5eaf..ba28df438 100755 --- a/tools/check-copyright.sh +++ b/tools/check-copyright.sh @@ -6,12 +6,12 @@ FILES=0 FAILED="" for F in $(find . -name "*.go" -o -name "*.sh" -o -name "*.cpp" -o -name "*.cc" -o -name "*.h" \ -o -name "*.S" -o -name "*.py" -o -name "*.yml" -o -name "*.yaml" -o -name "*.fbs" \ - -o \( -path "./sys/*/*.txt" \) | egrep -v "/_include/|/gen/|/testdata/"); do + -o \( -path "./sys/*/*.txt" \) | grep -E -v "/_include/|/gen/|/testdata/"); do ((FILES+=1)) - cat $F | tr '\n' '_' | egrep "(//|#) Copyright 20[0-9]{2}(/20[0-9]{2})? syzkaller project authors\. All rights reserved\._(//|#) Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file\." >/dev/null + cat $F | tr '\n' '_' | grep -E "(//|#) Copyright 20[0-9]{2}(/20[0-9]{2})? syzkaller project authors\. All rights reserved\._(//|#) Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file\." >/dev/null if [ $? -eq 0 ]; then continue; fi # Ignore auto-generated files. - egrep "^(//|#) Code generated .* DO NOT EDIT\\.|(WARNING: This file is machine generated)|automatically generated by the FlatBuffers compiler" $F >/dev/null + grep -E "^(//|#) Code generated .* DO NOT EDIT\\.|(WARNING: This file is machine generated)|automatically generated by the FlatBuffers compiler" $F >/dev/null if [ $? -eq 0 ]; then continue; fi # Ignore untracked files. git ls-files --error-unmatch $F >/dev/null 2>&1 diff --git a/tools/check-language.sh b/tools/check-language.sh index b9c5d1d95..f3108ffa9 100755 --- a/tools/check-language.sh +++ b/tools/check-language.sh @@ -7,7 +7,7 @@ FAILED="" shopt -s nocasematch for F in $(find . -name "*.go" -o -name "*.sh" -o -name "*.cc" -o -name "*.md" \ -o -name "*.S" -o -name "*.py" -o -name "*.yml" -o -name "*.yaml" | \ - egrep -v "/gen/|executor/syscalls.h|dashboard/config/linux/bits|pkg/csource/generated.go|tools/check-language.sh"); do + grep -E -v "/gen/|executor/syscalls.h|dashboard/config/linux/bits|pkg/csource/generated.go|tools/check-language.sh"); do ((FILES+=1)) L=0 while IFS= read -r LINE; do 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 diff --git a/tools/check-whitespace.sh b/tools/check-whitespace.sh index 9fdbdf07d..63031bee8 100755 --- a/tools/check-whitespace.sh +++ b/tools/check-whitespace.sh @@ -7,7 +7,7 @@ FAILED="" RE="[[:space:]]$" LAST_EMPTY="" for F in $(find . -name "*.sh" -o -name "*.S" -o -name "*.py" -o -name "*.yml" -o -name "*.yaml" -o -name "*.md" | \ - egrep -v "/gen/"); do + grep -E -v "/gen/"); do ((FILES+=1)) L=0 while IFS= read -r LINE; do -- cgit mrf-deployment