diff --git a/src/bee-query.sh.in b/src/bee-query.sh.in index fbcec0f..c7b0df4 100644 --- a/src/bee-query.sh.in +++ b/src/bee-query.sh.in @@ -57,7 +57,7 @@ query() { eval $(${BEE_BINDIR}/beeversion $base) get_files "${PKGALLPKG}" else - get_pkgs ${f} + get_pkgs "${f}" fi done } @@ -68,10 +68,10 @@ get_files() { for s in "" "${BEE_METADIR}" ; do ff="${s}/${pkg}/CONTENT" if [ -e "${ff}" ] ; then - for line in $(cat ${ff}) ; do - eval $(${BEESEP} ${line}) + while read line ; do + eval $(${BEESEP} "${line}") echo ${file} - done + done < "${ff}" fi done } @@ -81,12 +81,12 @@ get_pkgs() { for pkg in $(${BEE_LIBEXECDIR}/bee/bee.d/bee-list --installed) ; do - if egrep -q "file=.*${f}" ${BEE_METADIR}/${pkg}/CONTENT ; then + if egrep -q "file=.*${f}" "${BEE_METADIR}/${pkg}/CONTENT" ; then echo ${pkg} - for line in $(egrep "file=.*${f}" ${BEE_METADIR}/${pkg}/CONTENT) ; do - eval $(${BEESEP} ${line}) + while read line ; do + eval $(${BEESEP} "${line}") echo " ${file}" - done + done < <(egrep "file=.*${f}" "${BEE_METADIR}/${pkg}/CONTENT") fi done }