Annotation of coherent/a/tmp/smail/utils/smail.prompt, revision 1.1

1.1     ! root        1: #
        !             2: # @(#)smail.prompt     2.5 (smail) 9/15/87
        !             3: #
        !             4: 
        !             5: loop=true
        !             6: while test $loop = true
        !             7: do 
        !             8:        case "$1" in
        !             9:        string)
        !            10:                echo "$2" 1>&2
        !            11:                read ans
        !            12:                if test ! -z "$ans"
        !            13:                then
        !            14:                        echo $ans
        !            15:                        loop=false;
        !            16:                fi
        !            17:        ;;
        !            18:        file)
        !            19:                echo "$2" 1>&2
        !            20:                read ans
        !            21:                case "$ans" in
        !            22:                /*)
        !            23:                        if test -f "$ans"
        !            24:                        then
        !            25:                                echo $ans
        !            26:                                loop=false;
        !            27:                        else
        !            28:                                echo "file '$ans' not found" 1>&2
        !            29:                        fi
        !            30:                ;;
        !            31:                *)
        !            32:                        echo "must give FULL PATH to file" 1>&2
        !            33:                ;;
        !            34:                esac
        !            35:        ;;
        !            36:        yesno)
        !            37:                echo "$2" 1>&2
        !            38:                read ans
        !            39:                case "$ans" in
        !            40:                y|Y|yes|Yes|YES)
        !            41:                        echo "yes"
        !            42:                        loop=false
        !            43:                ;;
        !            44:                n|N|no|No|NO)
        !            45:                        echo "no"
        !            46:                        loop=false
        !            47:                ;;
        !            48:                *)
        !            49:                        echo "Please enter yes or no" 1>&2
        !            50:                ;;
        !            51:                esac
        !            52:        ;;
        !            53:        *)
        !            54: 
        !            55:                echo "usage: $0 string|yesno prompt_message" 1>&2
        !            56:                echo BOGUS_PROMPT_STRING
        !            57:                loop=false
        !            58:        ;;
        !            59:        esac
        !            60: done

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.