treewide: Replace 'egrep' with 'grep -E'

Fixes the following warning:
```
egrep: warning: egrep is obsolescent; using grep -E
```
pull/17949/head
Timothée Ravier 2024-01-14 19:56:27 +01:00
parent 838ea0c7fb
commit 9c41c6536f
11 changed files with 18 additions and 18 deletions

View File

@ -19,9 +19,9 @@ VERSION_BUILD ?= 0
RAW_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
VERSION ?= v$(RAW_VERSION)
KUBERNETES_VERSION ?= $(shell egrep "DefaultKubernetesVersion =" pkg/minikube/constants/constants.go | cut -d \" -f2)
KIC_VERSION ?= $(shell egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f2)
HUGO_VERSION ?= $(shell egrep "HUGO_VERSION = \"" netlify.toml | cut -d \" -f2)
KUBERNETES_VERSION ?= $(shell grep -E "DefaultKubernetesVersion =" pkg/minikube/constants/constants.go | cut -d \" -f2)
KIC_VERSION ?= $(shell grep -E "Version =" pkg/drivers/kic/types.go | cut -d \" -f2)
HUGO_VERSION ?= $(shell grep -E "HUGO_VERSION = \"" netlify.toml | cut -d \" -f2)
# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
ISO_VERSION ?= v1.32.1-1703784139-17866

View File

@ -23,7 +23,7 @@ data:
curl -Ls "https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-operator.yaml" -o /manifests/kubevirt-operator.yaml
kubectl create -f /manifests/kubevirt-operator.yaml
HARDWARE_EMULATION=$(egrep 'svm|vmx' /proc/cpuinfo)
HARDWARE_EMULATION=$(grep -E 'svm|vmx' /proc/cpuinfo)
if [ -z "$HARDWARE_EMULATION" ]; then
echo "Using software emulation"

View File

@ -42,8 +42,8 @@ sudo apt-get -y install build-essential unzip rsync bc python3 p7zip-full
curl -L https://github.com/kubernetes/minikube/raw/master/Makefile --output Makefile-head
# ISO tags are of the form VERSION-TIMESTAMP-PR, so this grep finds that TIMESTAMP in the middle
# if it doesn't exist, it will just return VERSION, which is covered in the if statement below
HEAD_ISO_TIMESTAMP=$(egrep "ISO_VERSION \?= " Makefile-head | cut -d \" -f 2 | cut -d "-" -f 2)
CURRENT_ISO_TS=$(egrep "ISO_VERSION \?= " Makefile | cut -d \" -f 2 | cut -d "-" -f 2)
HEAD_ISO_TIMESTAMP=$(grep -E "ISO_VERSION \?= " Makefile-head | cut -d \" -f 2 | cut -d "-" -f 2)
CURRENT_ISO_TS=$(grep -E "ISO_VERSION \?= " Makefile | cut -d \" -f 2 | cut -d "-" -f 2)
if [[ $HEAD_ISO_TIMESTAMP != v* ]]; then
diff=$((CURRENT_ISO_TS-HEAD_ISO_TIMESTAMP))
if [[ $CURRENT_ISO_TS == v* ]] || [ $diff -lt 0 ]; then
@ -55,7 +55,7 @@ rm Makefile-head
if [[ -z $ISO_VERSION ]]; then
release=false
IV=$(egrep "ISO_VERSION \?=" Makefile | cut -d " " -f 3 | cut -d "-" -f 1)
IV=$(grep -E "ISO_VERSION \?=" Makefile | cut -d " " -f 3 | cut -d "-" -f 1)
now=$(date +%s)
export ISO_VERSION=$IV-$now-$ghprbPullId
export ISO_BUCKET=minikube-builds/iso/$ghprbPullId

View File

@ -345,7 +345,7 @@ if [ "$(uname)" != "Darwin" ]; then
docker build -t gcr.io/k8s-minikube/gvisor-addon:2 -f testdata/gvisor-addon-Dockerfile ./testdata
fi
readonly LOAD=$(uptime | egrep -o "load average.*: [0-9]+" | cut -d" " -f3)
readonly LOAD=$(uptime | grep -E -o "load average.*: [0-9]+" | cut -d" " -f3)
if [[ "${LOAD}" -gt 2 ]]; then
echo ""
echo "********************** LOAD WARNING ********************************"

View File

@ -21,7 +21,7 @@ function check_jenkins() {
return
fi
pstree "${jenkins_pid}" \
| egrep -i 'bash|integration|e2e|minikube' \
| grep -E -i 'bash|integration|e2e|minikube' \
&& echo "tests are running on pid ${jenkins_pid} ..." \
&& exit 1
}

View File

@ -39,8 +39,8 @@ export PATH=$PATH:$GOBIN
curl -L https://github.com/kubernetes/minikube/raw/master/pkg/drivers/kic/types.go --output types-head.go
# kicbase tags are of the form VERSION-TIMESTAMP-PR, so this grep finds that TIMESTAMP in the middle
# if it doesn't exist, it will just return VERSION, which is covered in the if statement below
HEAD_KIC_TIMESTAMP=$(egrep "Version =" types-head.go | cut -d \" -f 2 | cut -d "-" -f 2)
CURRENT_KIC_TS=$(egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f 2 | cut -d "-" -f 2)
HEAD_KIC_TIMESTAMP=$(grep -E "Version =" types-head.go | cut -d \" -f 2 | cut -d "-" -f 2)
CURRENT_KIC_TS=$(grep -E "Version =" pkg/drivers/kic/types.go | cut -d \" -f 2 | cut -d "-" -f 2)
if [[ $HEAD_KIC_TIMESTAMP != v* ]]; then
diff=$((CURRENT_KIC_TS-HEAD_KIC_TIMESTAMP))
if [[ $CURRENT_KIC_TS == v* ]] || [ $diff -lt 0 ]; then
@ -55,7 +55,7 @@ if [[ -z $KIC_VERSION ]]; then
# Testing PRs here
release=false
now=$(date +%s)
KV=$(egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f 2 | cut -d "-" -f 1)
KV=$(grep -E "Version =" pkg/drivers/kic/types.go | cut -d \" -f 2 | cut -d "-" -f 1)
GCR_REPO=gcr.io/k8s-minikube/kicbase-builds
DH_REPO=docker.io/kicbase/build
export KIC_VERSION=$KV-$now-$ghprbPullId

View File

@ -44,7 +44,7 @@ if [ $ec -gt 0 ]; then
fi
# Bump the preload version
PLV=$(egrep "PreloadVersion =" pkg/minikube/download/preload.go | cut -d \" -f 2)
PLV=$(grep -E "PreloadVersion =" pkg/minikube/download/preload.go | cut -d \" -f 2)
RAW=${PLV:1}
RAW=$((RAW+1))
PLV=v${RAW}

View File

@ -21,8 +21,8 @@ if [ "$#" -ne 1 ]; then
exit 1
fi
readonly version=$(egrep "CRI_DOCKERD_VERSION=" ../../../deploy/kicbase/Dockerfile | cut -d \" -f2)
readonly commit=$(egrep "CRI_DOCKERD_COMMIT=" ../../../deploy/kicbase/Dockerfile | cut -d \" -f2)
readonly version=$(grep -E "CRI_DOCKERD_VERSION=" ../../../deploy/kicbase/Dockerfile | cut -d \" -f2)
readonly commit=$(grep -E "CRI_DOCKERD_COMMIT=" ../../../deploy/kicbase/Dockerfile | cut -d \" -f2)
archlist=$1
IFS=, read -a archarray <<< "$archlist"

View File

@ -38,7 +38,7 @@ readonly UNIT_PATH=$1
while true; do
if [[ -f "${UNIT_PATH}" ]]; then
eval $(egrep "^ExecStart=" "${UNIT_PATH}" | cut -d"=" -f2-)
eval $(grep -E "^ExecStart=" "${UNIT_PATH}" | cut -d"=" -f2-)
fi
sleep 1
done

View File

@ -1,7 +1,7 @@
To use VM drivers, verify that your system has virtualization support enabled:
```shell
egrep -q 'vmx|svm' /proc/cpuinfo && echo yes || echo no
grep -E -q 'vmx|svm' /proc/cpuinfo && echo yes || echo no
```
If the above command outputs "no":

View File

@ -45,7 +45,7 @@ then
readonly BDIR="${ROOT_DIR}/hack/boilerplate"
pushd . >/dev/null
cd ${BDIR}
missing="$(go run boilerplate.go -rootdir ${ROOT_DIR} -boilerplate-dir ${BDIR} | egrep -v '/assets.go|/translations.go|/site/themes/|/site/node_modules|\./out|/hugo/|hack/benchmark/time-to-k8s/time-to-k8s-repo' || true)"
missing="$(go run boilerplate.go -rootdir ${ROOT_DIR} -boilerplate-dir ${BDIR} | grep -E -v '/assets.go|/translations.go|/site/themes/|/site/node_modules|\./out|/hugo/|hack/benchmark/time-to-k8s/time-to-k8s-repo' || true)"
if [[ -n "${missing}" ]]; then
echo "boilerplate missing: $missing"
echo "consider running: ${BDIR}/fix.sh"