--- genlop.old 2006-12-22 10:54:24.000000000 -0500 +++ genlop 2006-12-22 11:12:44.000000000 -0500 @@ -17,13 +17,13 @@ origdir="${PWD}" COMPREPLY=() portagedir="$( (source /etc/make.conf; echo ${PORTDIR}) )" - if [ ${portagedir} = "" ]; then + if [ "${portagedir}" = "" ]; then portagedir=/usr/portage fi cur="${COMP_WORDS[COMP_CWORD]}" cd "${portagedir}" - grepcmd="grep -E ^${cur}.*" + grepcmd="grep -e ^${cur}.*" sedcmd="sed -e /^[^-]*$/d" case "$cur" in -*) @@ -33,12 +33,12 @@ ;; *) if [ "${cur}" ]; then - if [ $(echo "${cur}" | grep '/') ]; then + if [ "$(echo "${cur}" | grep '/')" ]; then setbig=$(compgen -G "${cur}*" | ${sedcmd})"${systemactions}" COMPREPLY=($(echo "${setbig}" | $grepcmd)) else setsma=$(compgen -S '/' -G "${cur}*" | ${sedcmd})"${systemactions}" - if [ $(echo "${setsma}" | ${grepcmd} | grep '/' | wc -l) = 1 ]; then + if [ "$(echo "${setsma}" | ${grepcmd} | grep '/' | wc -l)" = 1 ]; then setbig=$(compgen -G "*/*" | ${sedcmd})"${systemactions}" COMPREPLY=($(echo "${setbig}" | ${grepcmd})) else