diff options
author | Mark Wielaard <mark@klomp.org> | 2019-07-12 00:50:54 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2019-07-12 00:50:54 +0200 |
commit | 33414da1d2bedf2cbe693f0e21fdaef11d221b1d (patch) | |
tree | ce0f7bb6531df982a14205fe0e2e8d4810216105 | |
parent | f7d209bfde37cf337f769531f9c7a29b8bb6ae7f (diff) | |
download | bzip2-33414da1d2bedf2cbe693f0e21fdaef11d221b1d.tar.gz |
Fix bashism in bzgrep
bzgrep uses ${var//} which is a bashism.
Replace by calling sed so other POSIX shells work.
Patch from openSUSE by Led <ledest@gmail.com>
-rw-r--r-- | bzgrep | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -63,9 +63,7 @@ for i do bzip2 -cdfq "$i" | $grep $opt "$pat" r=$? else - j=${i//\\/\\\\} - j=${j//|/\\|} - j=${j//&/\\&} + j=$(echo "$i" | sed 's/\\/&&/g;s/|/\\&/g;s/&/\\&/g') j=`printf "%s" "$j" | tr '\n' ' '` bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|" r=$? |