From 3dda4ba24c58e00bc2c883dc54985f4a20fef843 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Wed, 21 Sep 2022 19:36:22 +0000 Subject: [PATCH] all: replace deprecated egrep with grep -E egrep command is about to be deprecated, use grep -E instead. Reference: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap04.html Change-Id: Ib37f5b244ead4c2d46078bea34d4cb6363c48b1b GitHub-Last-Rev: b1e16d0212d682c780668e62ac8659973bb11a9d GitHub-Pull-Request: golang/tools#400 Reviewed-on: https://go-review.googlesource.com/c/tools/+/432295 Reviewed-by: Bryan Mills Reviewed-by: Robert Findley --- cmd/toolstash/buildall | 4 ++-- gopls/internal/hooks/gen-licenses.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/toolstash/buildall b/cmd/toolstash/buildall index 0c6492c9ef..4fc22f7f8f 100755 --- a/cmd/toolstash/buildall +++ b/cmd/toolstash/buildall @@ -38,10 +38,10 @@ if [ "$pattern" = "" ]; then fi targets="$(go tool dist list; echo linux/386/softfloat)" -targets="$(echo "$targets" | tr '/' '-' | sort | egrep "$pattern" | egrep -v 'android-arm|darwin-arm')" +targets="$(echo "$targets" | tr '/' '-' | sort | grep -E "$pattern" | grep -E -v 'android-arm|darwin-arm')" # put linux first in the target list to get all the architectures up front. -targets="$(echo "$targets" | egrep 'linux') $(echo "$targets" | egrep -v 'linux')" +targets="$(echo "$targets" | grep -E 'linux') $(echo "$targets" | grep -E -v 'linux')" if [ "$sete" = true ]; then set -e diff --git a/gopls/internal/hooks/gen-licenses.sh b/gopls/internal/hooks/gen-licenses.sh index 7d6bab79f5..c35c91260d 100755 --- a/gopls/internal/hooks/gen-licenses.sh +++ b/gopls/internal/hooks/gen-licenses.sh @@ -27,7 +27,7 @@ mods=$(go list -deps -f '{{with .Module}}{{.Path}}{{end}}' golang.org/x/tools/go for mod in $mods; do # Find the license file, either LICENSE or COPYING, and add it to the result. dir=$(go list -m -f {{.Dir}} $mod) - license=$(ls -1 $dir | egrep -i '^(LICENSE|COPYING)$') + license=$(ls -1 $dir | grep -E -i '^(LICENSE|COPYING)$') echo "-- $mod $license --" >> $tempfile echo >> $tempfile sed 's/^-- / &/' $dir/$license >> $tempfile