Fixed 'grep: write error' bug when running with sudo su -

This commit is contained in:
Matteo Rossini 2016-01-02 23:06:52 +01:00
parent f26844a3be
commit a03840cf6a

View file

@ -727,7 +727,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then
#
PKGDATA=""
LINEIDX=""
PKGINFOS=$(grep -n "^${DIR} " ${TMPDIR}/pkglist | grep -w "${PAT}" | grep -m 1 "^[[:digit:]]\+:${DIR} ${ARGUMENT} ")
grep -n "^${DIR} " ${TMPDIR}/pkglist | grep -w "${PAT}" > ${TMPDIR}/packages.matches
PKGINFOS=$(grep -m 1 "^[[:digit:]]\+:${DIR} ${ARGUMENT} " ${TMPDIR}/packages.matches)
if [ ! -z "$PKGINFOS" ] ; then
LINEIDX=$(echo "$PKGINFOS" | cut -f1 -d":")