Mass Deface
Email Grabber
/dev/null && echo "$i"
status_grep=$?
elif test $silent -eq 1; then
# "-h": Show only the matching line(s), not the archive member name.
# ("-s" in "opt" will silence "egrep", stopping all output.)
unzip -p-L "$zipfile" "$i" | \
egrep $opt "$pat"
status_grep=$?
else
# Escape (or re-escape) shell-special characters in the archive
# member name, "i".
i=` echo "$i" | \
sed -e 's/\\\\/\\\\\\\\/g' -e 's/|/\\\|/g' -e 's/&/\\\&/g' `
# Globally, send fd 4 to stdout. In the pipeline, send normal
# stdout to fd 4, and send grep status to fd 3. Collect fd 3
# with ``.
exec 4>&1
status_grep=` ( \
( unzip -p-L "$zipfile" "$i" | \
egrep $opt "$pat" 1>&4 ; echo $? >&3 ) 4>&1 | \
sed "s|^|${i}:|" 1>&4 \
) 3>&1 `
fi
# Save the primary command status. (May be the grep status.)
sts=$?
# If this grep status was zero, set the global grep status to zero.
test "$status_grep" -eq 0 && status_grep_global=0
# If this grep status was not zero or one, exit now.
test "$status_grep" -gt 1 && exit "$status_grep"
done
# If "sts" is good (0), then exit with the global grep status.
# Else, when "sts" is bad, exit with the worst status we can find.
if test $sts -eq 0 ; then
exit $status_grep_global
else
if test "$status_grep" -gt 1 ; then
exit "$status_grep"
else
exit $sts
fi
fi