selftests: powerpc: Use "grep -E" instead of "egrep"
authorTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 1 Dec 2022 02:49:57 +0000 (10:49 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 2 Dec 2022 07:04:27 +0000 (18:04 +1100)
The latest version of grep claims the egrep is now obsolete so the build
now contains warnings that look like:
egrep: warning: egrep is obsolescent; using grep -E
fix this using "grep -E" instead.

  sed -i "s/egrep/grep -E/g" `grep egrep -rwl tools/testing/selftests/powerpc`

Here are the steps to install the latest grep:

  wget http://ftp.gnu.org/gnu/grep/grep-3.8.tar.gz
  tar xf grep-3.8.tar.gz
  cd grep-3.8 && ./configure && make
  sudo make install
  export PATH=/usr/local/bin:$PATH

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1669862997-31335-1-git-send-email-yangtiezhu@loongson.cn
tools/testing/selftests/powerpc/scripts/hmi.sh

index dcdb392e8427591d13d17eee5228efcb9d126bee..bcc7b6b650099bba27fbdc9d7e3b5ca07750712e 100755 (executable)
@@ -36,7 +36,7 @@ trap "ppc64_cpu --smt-snooze-delay=100" 0 1
 
 # for each chip+core combination
 # todo - less fragile parsing
-egrep -o 'OCC: Chip [0-9a-f]+ Core [0-9a-f]' < /sys/firmware/opal/msglog |
+grep -E -o 'OCC: Chip [0-9a-f]+ Core [0-9a-f]' < /sys/firmware/opal/msglog |
 while read chipcore; do
        chip=$(echo "$chipcore"|awk '{print $3}')
        core=$(echo "$chipcore"|awk '{print $5}')