replace egrep/fgrep calls with grep -E/grep -F

as egrep/fgrep is deprecated since long amd grep 3.8+ now actually warns
(e.g. "egrep: warning: egrep is obsolescent; using grep -E")

Change-Id: I5b10f05dffdd09081deb05cef974e3cdb2907315
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139614
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Rene Engelhard
2022-09-07 21:34:42 +02:00
committed by Christian Lohmaier
parent 09e499e64e
commit fd42cea5f3
6 changed files with 11 additions and 11 deletions

View File

@@ -49,8 +49,8 @@ if [ "$len" -gt 79 ] ; then
fi fi
fdo_regex='fdo#[0-9]+' fdo_regex='fdo#[0-9]+'
if egrep -q "$fdo_regex" $1; then if grep -E -q "$fdo_regex" $1; then
for bugid in `head -n 1 $1 |egrep -o "$fdo_regex" |sed 's/fdo#//'` for bugid in `head -n 1 $1 | grep -E -o "$fdo_regex" |sed 's/fdo#//'`
do do
if [ "`echo $bugid |sed 's/fdo#//'`" -gt 88775 ]; then if [ "`echo $bugid |sed 's/fdo#//'`" -gt 88775 ]; then
abort "$1" "The first line contains a suspicious fdo# rereference: 'fdo#$bugid', did you mean tdf#?" abort "$1" "The first line contains a suspicious fdo# rereference: 'fdo#$bugid', did you mean tdf#?"

View File

@@ -130,8 +130,8 @@ if $cygwin ; then
# Now convert the arguments - kludge to limit ourselves to /bin/sh # Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0 i=0
for arg in "$@" ; do for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK=`echo "$arg"|grep -E -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option CHECK2=`echo "$arg"|grep -E -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`

View File

@@ -235,7 +235,7 @@ class Parser:
# Change into the given dir, so "git ls-tree" does work. # Change into the given dir, so "git ls-tree" does work.
os.chdir(directory) os.chdir(directory)
sock = os.popen(r"git ls-tree -r HEAD --name-only |egrep '\.(c|cc|cpp|cxx|h|hxx|mm)$'") sock = os.popen(r"git ls-tree -r HEAD --name-only | grep -E '\.(c|cc|cpp|cxx|h|hxx|mm)$'")
lines = sock.readlines() lines = sock.readlines()
sock.close() sock.close()

View File

@@ -2945,7 +2945,7 @@ AC_SUBST(GNUPARALLEL)
AC_MSG_CHECKING([for GNU or BSD tar]) AC_MSG_CHECKING([for GNU or BSD tar])
for a in $GNUTAR gtar gnutar tar bsdtar /usr/sfw/bin/gtar; do for a in $GNUTAR gtar gnutar tar bsdtar /usr/sfw/bin/gtar; do
$a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null $a --version 2> /dev/null | grep -E "GNU|bsdtar" 2>&1 > /dev/null
if test $? -eq 0; then if test $? -eq 0; then
GNUTAR=$a GNUTAR=$a
break break
@@ -2958,11 +2958,11 @@ fi
AC_SUBST(GNUTAR) AC_SUBST(GNUTAR)
AC_MSG_CHECKING([for tar's option to strip components]) AC_MSG_CHECKING([for tar's option to strip components])
$GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null $GNUTAR --help 2> /dev/null | grep -E "bsdtar|strip-components" 2>&1 >/dev/null
if test $? -eq 0; then if test $? -eq 0; then
STRIP_COMPONENTS="--strip-components" STRIP_COMPONENTS="--strip-components"
else else
$GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null $GNUTAR --help 2> /dev/null | grep -E "strip-path" 2>&1 >/dev/null
if test $? -eq 0; then if test $? -eq 0; then
STRIP_COMPONENTS="--strip-path" STRIP_COMPONENTS="--strip-path"
else else

View File

@@ -242,7 +242,7 @@ while ( (!$main::correctVersion) &&
} else } else
{ {
#check version #check version
my $testVersion = `$OO_SDK_ZIP_HOME/zip -h 2>&1 | egrep Zip | head -n 1`; my $testVersion = `$OO_SDK_ZIP_HOME/zip -h 2>&1 | grep -E Zip | head -n 1`;
$testVersion =~ s#Zip ([\d.]+) .*#$1#go; $testVersion =~ s#Zip ([\d.]+) .*#$1#go;
if ( $testVersion eq "") if ( $testVersion eq "")
{ {
@@ -414,7 +414,7 @@ while ( (!$main::correctVersion) &&
} else } else
{ {
#check version #check version
my $testVersion = `$main::OO_SDK_JAVA_HOME/bin/java -version 2>&1 | egrep "java version" | head -n 1 | sed -e 's#.*version "##' | sed -e 's#".*##'`; my $testVersion = `$main::OO_SDK_JAVA_HOME/bin/java -version 2>&1 | grep -E "java version" | head -n 1 | sed -e 's#.*version "##' | sed -e 's#".*##'`;
$testVersion =~ s#([^\n]+)\n#$1#go; $testVersion =~ s#([^\n]+)\n#$1#go;
$main::correctVersion = testVersion($main::javaVersion, $testVersion, "$main::OO_SDK_JAVA_HOME/bin/java", 1); $main::correctVersion = testVersion($main::javaVersion, $testVersion, "$main::OO_SDK_JAVA_HOME/bin/java", 1);

View File

@@ -34,7 +34,7 @@
# #
################################################### ###################################################
egrep "Node connection|Node state" $1 | \ grep -E "Node connection|Node state" $1 | \
sed -e '/Node state/ s/.*Node state.*: \(.*\)/\1/' \ sed -e '/Node state/ s/.*Node state.*: \(.*\)/\1/' \
-e '/Node connection/ s/.*Node connection.*: \(n.*\)/\1/' | \ -e '/Node connection/ s/.*Node connection.*: \(n.*\)/\1/' | \
\ \