Replace "egrep" with "grep -E" in scripts
PATCH 1/1 Replace "egrep" with "grep -E" in scripts
In the NEWS section of grep 3.8 announce letter [1], there is a note which reads:
** Changes in behavior
...
The egrep and fgrep commands, which have been deprecated since release 2.5.3 (2007), now warn that they are obsolescent and should be replaced by grep -E and grep -F.
Replace "egrep" with "grep -E" in sh/bash scripts.
Note: There is no use of "fgrep" in perfbook tree.
---
Hi,
This change is prompted by Tiezhu Yang's patch updating a script of LKMM [2, 3].
[2] v1: https://lore.kernel.org/r/[email protected]/
[3] v2: https://lore.kernel.org/r/[email protected]/
Thanks, Akira
--
CodeSamples/SMPdesign/maze/reduce.bash | 16 ++++++++-------- CodeSamples/defer/rcudelay.sh | 2 +- CodeSamples/defer/rcuscale.sh | 2 +- utilities/gitextractcontrib.sh | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-)
CodeSamples/SMPdesign/maze/reduce.bash +8 -8
@@ -31,9 +31,9 @@ scatter_file () local i local j - for i in `ls | egrep '^[0-9]*$|^[0-9]*x[0-9]*$'` + for i in `ls | grep -E '^[0-9]*$|^[0-9]*x[0-9]*$'` do - for j in `ls $i/pct_* | egrep '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` + for j in `ls $i/pct_* | grep -E '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` do ms=`echo $j | sed 's/\/pct_/\/ms_/'` mstail=`echo $ms | sed 's/^[0-9]*\///'`
@@ -71,9 +71,9 @@ makecdf_file () local i local j - for i in `ls | egrep '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` + for i in `ls | grep -E '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` do - for j in `ls $i/ms_* $i/pct_* | egrep '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` + for j in `ls $i/ms_* $i/pct_* | grep -E '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` do makecdf $j done
@@ -127,9 +127,9 @@ quantile_error_file () local i local j - for i in `ls | egrep '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` + for i in `ls | grep -E '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` do - for j in `ls $i/ms_* $i/pct_* | egrep '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` + for j in `ls $i/ms_* $i/pct_* | grep -E '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` do f=`echo $j | sed -e 's/^.*\///'`.quant touch $f
@@ -158,9 +158,9 @@ average_file () local i local j - for i in `ls | egrep '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` + for i in `ls | grep -E '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` do - for j in `ls $i/ms_* $i/pct_* | egrep '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` + for j in `ls $i/ms_* $i/pct_* | grep -E '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` do f=`echo $j | sed -e 's/^.*\///'`.mean touch $f
CodeSamples/defer/rcudelay.sh +1 -1
@@ -98,7 +98,7 @@ do fi fi echo Run for $prim with $ncpus CPUs and delay $curdelay$fstr - egrep '^Points: | reader duration:' $T + grep -E '^Points: | reader duration:' $T done curdelay=`echo $curdelay | sed -e 's/5/10/' -e t -e 's/2/5/' -e t -e 's/1/2/'` done
CodeSamples/defer/rcuscale.sh +1 -1
@@ -93,7 +93,7 @@ do fi fi echo Run for $prim with $ncpus CPUs$fstr - egrep '^Points: | reader duration:' $T + grep -E '^Points: | reader duration:' $T done if ((ncpus >= 128)) then
utilities/gitextractcontrib.sh +1 -1
@@ -23,7 +23,7 @@ # # Authors: Paul E. McKenney <[email protected]> -git log $1 | egrep '^ *(Signed-off-by|Reported-by)' | +git log $1 | grep -E '^ *(Signed-off-by|Reported-by)' | sed -e 's/ *Signed-off-by: *//' -e 's/ *Reported-by: *//' | sort -u | grep -v "Paul E. McKenney" | sed -e 's/\([^<]*\)<\([^>]*\)>/\2 \1/' | sed -e 's/ *$//' |
base-commit: 64b2aa8513e974cfd9f53f744650617f1b9d66f4
Signature · 1 line
2.25.1
Paul E. McKenney
AppliedQuoted 10 lines · Akira Yokosawa
In the NEWS section of grep 3.8 announce letter [1], there is a note which reads:
** Changes in behavior
...The egrep and fgrep commands, which have been deprecated since release 2.5.3 (2007), now warn that they are obsolescent and should be replaced by grep -E and grep -F.
Quoted 6 lines
Replace "egrep" with "grep -E" in sh/bash scripts.
Note: There is no use of "fgrep" in perfbook tree.
Queued and pushed, thank you!
Thanx, Paul
Quoted 113 lines
---
Hi,This change is prompted by Tiezhu Yang's patch updating a script of LKMM [2, 3].
[2] v1: https://lore.kernel.org/r/[email protected]/
[3] v2: https://lore.kernel.org/r/[email protected]/Thanks, Akira
--CodeSamples/SMPdesign/maze/reduce.bash | 16 ++++++++-------- CodeSamples/defer/rcudelay.sh | 2 +- CodeSamples/defer/rcuscale.sh | 2 +- utilities/gitextractcontrib.sh | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-)CodeSamples/SMPdesign/maze/reduce.bash +8
-8@@ -31,9 +31,9 @@ scatter_file () local i local j - for i in `ls | egrep '^[0-9]*$|^[0-9]*x[0-9]*$'` + for i in `ls | grep -E '^[0-9]*$|^[0-9]*x[0-9]*$'` do - for j in `ls $i/pct_* | egrep '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` + for j in `ls $i/pct_* | grep -E '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` do ms=`echo $j | sed 's/\/pct_/\/ms_/'` mstail=`echo $ms | sed 's/^[0-9]*\///'`@@ -71,9 +71,9 @@ makecdf_file () local i local j - for i in `ls | egrep '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` + for i in `ls | grep -E '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` do - for j in `ls $i/ms_* $i/pct_* | egrep '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` + for j in `ls $i/ms_* $i/pct_* | grep -E '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` do makecdf $j done@@ -127,9 +127,9 @@ quantile_error_file () local i local j - for i in `ls | egrep '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` + for i in `ls | grep -E '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` do - for j in `ls $i/ms_* $i/pct_* | egrep '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` + for j in `ls $i/ms_* $i/pct_* | grep -E '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` do f=`echo $j | sed -e 's/^.*\///'`.quant touch $f@@ -158,9 +158,9 @@ average_file () local i local j - for i in `ls | egrep '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` + for i in `ls | grep -E '^[0-9]*$|^[0-9]*x[0-9]*$' | sort -k1n` do - for j in `ls $i/ms_* $i/pct_* | egrep '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` + for j in `ls $i/ms_* $i/pct_* | grep -E '^([0-9]*|[0-9]*x[0-9]*)/[a-zA-Z0-9_-]*$'` do f=`echo $j | sed -e 's/^.*\///'`.mean touch $fCodeSamples/defer/rcudelay.sh +1
-1@@ -98,7 +98,7 @@ do fi fi echo Run for $prim with $ncpus CPUs and delay $curdelay$fstr - egrep '^Points: | reader duration:' $T + grep -E '^Points: | reader duration:' $T done curdelay=`echo $curdelay | sed -e 's/5/10/' -e t -e 's/2/5/' -e t -e 's/1/2/'` doneCodeSamples/defer/rcuscale.sh +1
-1@@ -93,7 +93,7 @@ do fi fi echo Run for $prim with $ncpus CPUs$fstr - egrep '^Points: | reader duration:' $T + grep -E '^Points: | reader duration:' $T done if ((ncpus >= 128)) thenutilities/gitextractcontrib.sh +1
-1@@ -23,7 +23,7 @@ # # Authors: Paul E. McKenney <[email protected]> -git log $1 | egrep '^ *(Signed-off-by|Reported-by)' | +git log $1 | grep -E '^ *(Signed-off-by|Reported-by)' | sed -e 's/ *Signed-off-by: *//' -e 's/ *Reported-by: *//' | sort -u | grep -v "Paul E. McKenney" | sed -e 's/\([^<]*\)<\([^>]*\)>/\2 \1/' | sed -e 's/ *$//' |base-commit:
64b2aa8513e974cfd9f53f744650617f1b9d66f4Signature · 1 line
2.25.1