bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A Flaw


From: SoloCDM
Subject: A Flaw
Date: Thu, 13 Dec 2001 13:52:00 -0700

The attached sample (it isn't the entire script) has no problems
processing as is, but when I remove the comment from "FSCREEN" *or*
"echo $MFILTER $MFILTER_ANS", it automatically skips "read MANS" and
accepts the wildcard in the case as the answer for "MFILTER_ANS".

When I remove the tabs preceding every line, then the prompt for read
works, but with "FSCREEN" *and* "echo $MFILTER $MFILTER_ANS"
uncommented nothing happens to the screen.  If I copy down the
function lines for "FSCREEN" to replace "FSCREEN", nothing happens to
the screen.

This problem can be reproduced; therefore, what is causing the
problem?

*********************************************************************
Signed,
SoloCDM
FSCREEN () {
        clear
        echo -e "\n\t Query results will display momentarily"
        echo "[-] ************************************************ [-]"
        echo
}

FSCREEN

MFILTER_ANS=N
{
FPROCESS () {
        MFILE="${1}"
        [ -s "${MFILE}" ] && {
                MFOUND=`echo "${MFILE}" | sed '/\.summary$/!d'`
                [ -z "${MFOUND}" ] && {
                        MTYPE=`file "${MFILE}" | sed -e 's+^.*:++' -e 's+^[     
]*++g' -e 's+[  ]*$++g'`
                        case "${MTYPE}" in
                                'ASCII mail text')
                                        [ "${MFILTER_ANS}" = "N" ] && {
                                                clear
#echo $MTYPE $MFILTER_ANS
                                                echo
                                                echo -e "\tSearch the H)eader, 
B)ody, or bO)th? \c"
                                                read MANS
#                                               FSCREEN
                                                case ${MANS} in
                                                        h|H)
                                                                
MFILTER='formail -X "" -ds'
                                                                MFILTER_ANS=Y
                                                        ;;
                                                        b|B)
                                                                
MFILTER='formail -I "" -ds'
                                                                MFILTER_ANS=Y
                                                        ;;
                                                        *)
                                                                MFILTER_ANS=Y
                                                        ;;
                                                esac
                                        }
#echo $MFILTER $MFILTER_ANS
                                        [ -n "${MFILTER}" ] && {
                                                MFOUND=`${MFILTER} < "${MFILE}" 
| ${MEGREP} "${2}"`
                                        } || {
                                                MFOUND=`${MEGREP} "${2}" 
"${MFILE}"`
                                        }
                                ;;
                                *)
                                        MFOUND=`strings -a "${MFILE}" | 
${MEGREP} "${2}"`
                                ;;
                        esac
                        [ -n "${MFOUND}" ] && {
                                echo less +Gg \"${MFILE}\" >> 
"${MRBIN}find-match-files-${MSUBJECT}"
                                echo "\"${MFILE}\" \\" >> 
"${MRBIN}find-match-view-files-${MSUBJECT}"
                        }
                }
        }
}

[ -n "${3}" ] && {
        find "${MDIR}" -type f \( -iname '*'${3}'*' -o -iname '.*'${3}'*' \) 
-print |\
        while read f
        do
                FPROCESS "${f}"
        done
} || {
        find "${MDIR}" -type f -print |\
        while read f
        do
                FPROCESS "${f}"
        done
};
}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]