Merge pull request #10805 from balintTobik/egrep_removal

egrep/fgrep removal
This commit is contained in:
Greg Kurz 2025-01-30 18:26:59 +01:00 committed by GitHub
commit 0215d958da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 127 additions and 127 deletions

View File

@ -79,8 +79,8 @@ list_issues_for_pr()
# "<git-commit> <git-commit-msg>"
#
local issues=$(echo "$commits" |\
egrep -v "^( | )" |\
egrep -i "fixes:* *(#*[0-9][0-9]*)" |\
grep -v -E "^( | )" |\
grep -i -E "fixes:* *(#*[0-9][0-9]*)" |\
tr ' ' '\n' |\
grep "[0-9][0-9]*" |\
sed 's/[.,\#]//g' |\

View File

@ -198,7 +198,7 @@ it stores. When messages are suppressed, it is noted in the logs. This can be ch
for by looking for those notifications, such as:
```bash
$ sudo journalctl --since today | fgrep Suppressed
$ sudo journalctl --since today | grep -F Suppressed
Jun 29 14:51:17 mymachine systemd-journald[346]: Suppressed 4150 messages from /system.slice/docker.service
```

View File

@ -98,7 +98,7 @@ a number larger than `0` if you have either of the `vmx` or `svm` nested virtual
available:
```sh
$ minikube ssh "egrep -c 'vmx|svm' /proc/cpuinfo"
$ minikube ssh "grep -c -E 'vmx|svm' /proc/cpuinfo"
```
## Installing Kata Containers
@ -122,8 +122,8 @@ and will be executing a `sleep infinity` once it has successfully completed its
You can accomplish this by running the following:
```sh
$ podname=$(kubectl -n kube-system get pods -o=name | fgrep kata-deploy | sed 's?pod/??')
$ kubectl -n kube-system exec ${podname} -- ps -ef | fgrep infinity
$ podname=$(kubectl -n kube-system get pods -o=name | grep -F kata-deploy | sed 's?pod/??')
$ kubectl -n kube-system exec ${podname} -- ps -ef | grep -F infinity
```
> *NOTE:* This check only works for single node clusters, which is the default for Minikube.
@ -197,7 +197,7 @@ $ minikube ssh -- uname -a
And then compare that against the kernel that is running inside the container:
```sh
$ podname=$(kubectl get pods -o=name | fgrep php-apache-kata-qemu | sed 's?pod/??')
$ podname=$(kubectl get pods -o=name | grep -F php-apache-kata-qemu | sed 's?pod/??')
$ kubectl exec ${podname} -- uname -a
```

View File

@ -531,7 +531,7 @@ $ ls /dev/vfio
* Check that the modules load when inside the Kata Container.
```sh
bash-5.0# egrep "qat|usdm_drv" /proc/modules
bash-5.0# grep -E "qat|usdm_drv" /proc/modules
qat_c62xvf 16384 - - Live 0x0000000000000000 (O)
usdm_drv 86016 - - Live 0x0000000000000000 (O)
intel_qat 184320 - - Live 0x0000000000000000 (O)

View File

@ -42,7 +42,7 @@ The following is an example of how to use `lspci` to check if your NIC supports
SR-IOV.
```
$ lspci | fgrep -i ethernet
$ lspci | grep -i -F ethernet
01:00.0 Ethernet controller: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 03)
...

View File

@ -24,7 +24,7 @@ _kata_get_subcmd_options()
local subcmd="$1"
"$_kataruntime" "$subcmd" --help |\
egrep -- "^ *--[^ ]*[ ][^ ]*" |\
grep -E -- "^ *--[^ ]*[ ][^ ]*" |\
awk '{print $1}' |\
tr -d \, |\
sort

View File

@ -277,8 +277,8 @@ find_system_journal_problems()
local problems=$(journalctl -q -o cat -a "$selector" "$program" |\
grep "time=" |\
egrep -i "$problem_pattern" |\
egrep -iv "$problem_exclude_pattern" |\
grep -i -E "$problem_pattern" |\
grep -iv -E "$problem_exclude_pattern" |\
tail -n ${PROBLEM_LIMIT})
if [ -n "$problems" ]; then
@ -370,11 +370,11 @@ show_package_versions()
pattern+=")"
if have_cmd "dpkg"; then
run_cmd_and_show_quoted_output "" "dpkg -l|egrep \"$pattern\""
run_cmd_and_show_quoted_output "" "dpkg -l|grep -E \"$pattern\""
fi
if have_cmd "rpm"; then
run_cmd_and_show_quoted_output "" "rpm -qa|egrep \"$pattern\""
run_cmd_and_show_quoted_output "" "rpm -qa|grep -E \"$pattern\""
fi
separator
@ -633,7 +633,7 @@ get_image_file()
local image=$(eval "$cmdline" 2>/dev/null |\
grep -A 1 '^\[Image\]' |\
egrep "\<Path\> =" |\
grep -E "\<Path\> =" |\
awk '{print $3}' |\
tr -d '"')
@ -648,7 +648,7 @@ get_initrd_file()
local initrd=$(eval "$cmdline" 2>/dev/null |\
grep -A 1 '^\[Initrd\]' |\
egrep "\<Path\> =" |\
grep -E "\<Path\> =" |\
awk '{print $3}' |\
tr -d '"')
@ -742,7 +742,7 @@ show_throttler_details()
throttlers=$(find /usr/libexec /usr/lib* -type f |\
grep -v trigger |\
egrep "(cc|kata)-ksm-throttler" |\
grep -E "(cc|kata)-ksm-throttler" |\
sort -u)
echo "$throttlers" | while read throttler

View File

@ -286,7 +286,7 @@ show_procs()
local regex
regex="(${pattern_list})"
ps -efww | egrep -i "$regex" || true
ps -efww | grep -i -E "$regex" || true
}
kill_tmux_sessions()
@ -961,7 +961,7 @@ get_addresses()
if [ $configured_hypervisor = "qemu" ]; then
addresses=$(ss -Hp --vsock |\
egrep -v "\<socat\>" |\
grep -v -E "\<socat\>" |\
awk '$2 ~ /^ESTAB$/ {print $6}' |\
grep ":${EXPECTED_VSOCK_PORT}$")
elif [ $configured_hypervisor = "clh" ]; then
@ -1166,7 +1166,7 @@ validate_agent()
# Regular expression that describes possible agent failures
local regex="(slog::Fuse|Drain|Custom|serialization error|thread.*panicked|stack backtrace:)"
egrep -q "$regex" "$log_file" && cat $log_file && die "Found agent error in log file: '$log_file'"
grep -q -E "$regex" "$log_file" && cat $log_file && die "Found agent error in log file: '$log_file'"
local entry
entry=$(get_shutdown_test_type_entry "$shutdown_test_type" || true)
@ -1186,7 +1186,7 @@ validate_agent()
# The message the agent writes to stderr just before it exits.
local done_msg="\<shutdown complete\>"
egrep -q "$done_msg" "$log_file" || (cat $log_file && die "missing agent shutdown message")
grep -q -E "$done_msg" "$log_file" || (cat $log_file && die "missing agent shutdown message")
else
# We can only check for the shutdown message if the agent debug
# logs are available.

View File

@ -76,7 +76,7 @@ create_user_data() {
dnf_proxy=""
service_proxy=""
docker_user_proxy="{}"
environment=$(env | egrep "ghprb|WORKSPACE|KATA|GIT|JENKINS|_PROXY|_proxy" | \
environment=$(env | grep -E "ghprb|WORKSPACE|KATA|GIT|JENKINS|_PROXY|_proxy" | \
sed -e "s/'/'\"'\"'/g" \
-e "s/\(^[[:alnum:]_]\+\)=/\1='/" \
-e "s/$/'/" \

View File

@ -638,7 +638,7 @@ errors=$(
signals=$(
echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |
egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
grep -v -E '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
sort
)
@ -648,7 +648,7 @@ echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags |
sort >_error.grep
echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' |
egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
grep -v -E '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
sort >_signal.grep
echo '// mkerrors.sh' "$@"

View File

@ -200,7 +200,7 @@ function grab_system() {
((anon*=1024))
# Mapped pages
local mapped=$(egrep "^Mapped:" /proc/meminfo | awk '{print $2}')
local mapped=$(grep -E "^Mapped:" /proc/meminfo | awk '{print $2}')
((mapped*=1024))
# Cached

View File

@ -429,7 +429,7 @@ static_check_license_headers()
info "Checking $desc"
local missing=$(egrep \
local missing=$(grep \
--exclude=".git/*" \
--exclude=".gitignore" \
--exclude=".dockerignore" \
@ -475,7 +475,7 @@ static_check_license_headers()
--exclude="src/mem-agent/example/protocols/protos/google/protobuf/*.proto" \
--exclude="src/libs/*/test/texture/*" \
--exclude="*.dic" \
-EL $extra_args "\<${pattern}\>" \
-EL $extra_args -E "\<${pattern}\>" \
$files || true)
if [ -n "$missing" ]; then
@ -783,7 +783,7 @@ static_check_docs()
local exclude_pattern
# Convert the list of files into an egrep(1) alternation pattern.
# Convert the list of files into an grep(1) alternation pattern.
exclude_pattern=$(echo "${exclude_doc_regexs[@]}"|sed 's, ,|,g')
# Every document in the repo (except a small handful of exceptions)
@ -792,7 +792,7 @@ static_check_docs()
do
# Check the ignore list for markdown files that do not need to
# be referenced by others.
echo "$doc"|egrep -q "(${exclude_pattern})" && continue
echo "$doc"|grep -q -E "(${exclude_pattern})" && continue
grep -q "$doc" "$md_links" || die "Document $doc is not referenced"
done
@ -827,7 +827,7 @@ static_check_docs()
if [ "$specific_branch" != "true" ]
then
# If the URL is new on this PR, it cannot be checked.
echo "$new_urls" | egrep -q "\<${url}\>" && \
echo "$new_urls" | grep -q -E "\<${url}\>" && \
info "ignoring new (but correct) URL: $url" && continue
fi
@ -925,12 +925,12 @@ static_check_eof()
[ "$file" == "Vagrantfile" ] && return
local invalid=$(cat "$file" |\
egrep -o '<<-* *\w*' |\
grep -o -E '<<-* *\w*' |\
sed -e 's/^<<-*//g' |\
tr -d ' ' |\
sort -u |\
egrep -v '^$' |\
egrep -v "$anchor" || true)
grep -v -E '^$' |\
grep -v -E "$anchor" || true)
[ -z "$invalid" ] || die "Expected '$anchor' here anchor, in $file found: $invalid"
}
@ -957,7 +957,7 @@ static_check_files()
then
info "Checking all files in $branch branch"
files=$(git ls-files | egrep -v "/(.git|vendor|grpc-rs|target)/" || true)
files=$(git ls-files | grep -v -E "/(.git|vendor|grpc-rs|target)/" || true)
else
info "Checking local branch for changed files only"
@ -979,7 +979,7 @@ static_check_files()
# Look for files containing the specified comment tags but
# which do not include a github URL.
match=$(egrep -H "\<FIXME\>|\<TODO\>" "$file" |\
match=$(grep -H -E "\<FIXME\>|\<TODO\>" "$file" |\
grep -v "https://github.com/.*/issues/[0-9]" |\
cut -d: -f1 |\
sort -u || true)