From 33414da1d2bedf2cbe693f0e21fdaef11d221b1d Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 12 Jul 2019 00:50:54 +0200 Subject: 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 --- bzgrep | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'bzgrep') diff --git a/bzgrep b/bzgrep index 9a04b83..5080afd 100644 --- a/bzgrep +++ b/bzgrep @@ -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=$? -- cgit v1.2.3-55-g6feb