summaryrefslogtreecommitdiffstats
path: root/lzgrep
diff options
context:
space:
mode:
Diffstat (limited to 'lzgrep')
-rwxr-xr-xlzgrep12
1 files changed, 6 insertions, 6 deletions
diff --git a/lzgrep b/lzgrep
index 0991f58..9cb2e49 100755
--- a/lzgrep
+++ b/lzgrep
@@ -44,7 +44,7 @@ while [ x"$1" != x ] ; do
echo "Lzip home page: http://www.nongnu.org/lzip/lzip.html"
exit 0 ;;
--version | --ve* | -V)
- echo "Lzgrep 0.4"
+ echo "Lzgrep 0.5"
echo "Copyright (C) 2009 Antonio Diaz Diaz."
echo "This script is free software: you have unlimited permission"
echo "to copy, distribute and modify it."
@@ -56,7 +56,7 @@ while [ x"$1" != x ] ; do
--lz*)
default_prog=lzip ;;
-[drRzZ] | --di* | --exc* | --inc* | --nu* | --rec*)
- echo "${invocation_name}: option $1 not supported\n"
+ echo "${invocation_name}: option $1 not supported"
exit 1 ;;
-e?* | -f?* | --file=* | --reg*=*)
args="${args} $1"; have_pat=1 ;;
@@ -116,15 +116,15 @@ for i in "$@" ; do
fi ;;
esac
if test ${list} -eq 1; then
- ${prog} -- "$i" | grep ${args} 2>&1 > /dev/null && echo $i
+ ${prog} -- "$i" | grep ${args} 2>&1 > /dev/null && echo "$i"
r=$?
elif test $# -eq 1 -o ${no_name} -eq 1; then
${prog} -- "$i" | grep ${args}
r=$?
else
- j=${i//\\/\\\\}
- j=${j//|/\\|}
- j=${j//&/\\&}
+ j=`printf "%s" "$i" | sed 's/\\\\/\\\\\\\\/g'`
+ j=`printf "%s" "$j" | sed 's/|/\\\\|/g'`
+ j=`printf "%s" "$j" | sed 's/&/\\\\&/g'`
j=`printf "%s" "$j" | tr '\n' ' '`
${prog} -- "$i" | grep ${args} | sed "s|^|${j}:|"
r=$?