Annotation of researchv10dc/cmd/netnews/config/postnews.ihcc, revision 1.1.1.1

1.1       root        1: : '%W% %G%'
                      2: TMP="/usr/tmp"
                      3: 
                      4: FILE=''
                      5: GROUP=''
                      6: OTHER=''
                      7: TITLE=''
                      8: 
                      9: while [ $# -gt 0 ]
                     10: do
                     11:        case $1 in
                     12:                -t)
                     13:                        TITLE=$2
                     14:                        shift
                     15:                        ;;
                     16:                -n)
                     17:                        GROUP=$2
                     18:                        shift
                     19:                        ;;
                     20:                -f)
                     21:                        FILE=$2
                     22:                        shift
                     23:                        ;;
                     24:                *)
                     25:                        OTHER="${OTHER} $1"
                     26:                        ;;
                     27:        esac
                     28:        shift
                     29: done
                     30: 
                     31: while [ "${TITLE}x" = "x" ]
                     32: do
                     33:        echo "Title: \c"
                     34:        read TITLE
                     35: done
                     36: 
                     37: if [ "${GROUP}x" = "x" ]
                     38: then
                     39:        echo "Newsgroups (general): \c"
                     40:        read GROUP
                     41:        if [ "${GROUP}x" = x ]
                     42:        then
                     43:                GROUP="general"
                     44:        fi
                     45: fi
                     46: 
                     47: if [ "${FILE}x" != "x" ]
                     48: then
                     49:        if [ -r ${FILE} ]
                     50:        then
                     51:                inews -t "${TITLE}" -n ${GROUP} ${OTHER}< $FILE
                     52:                exit
                     53:        else
                     54:                echo "$0: can not read ${FILE}"
                     55:                exit 1
                     56:        fi
                     57: fi
                     58: 
                     59: FILE="${TMP}/pn$$"
                     60: trap "sleep 1; cp $t $HOME/dead.article ; echo saved in $HOME/dead.article ; rm -f ${FILE}; exit" 0 1 2
                     61: touch ${FILE}
                     62: 
                     63: ${EDITOR:-vi} ${FILE}
                     64: 
                     65: if inews -t "${TITLE}" -n ${GROUP} ${OTHER} < ${FILE}
                     66: then
                     67:        :
                     68: else
                     69:        if cat ${FILE} >> ${HOME}/dead.news
                     70:        then
                     71:                echo "Article saved in ${HOME}/dead.news"
                     72:        fi
                     73: fi

unix.superglobalmegacorp.com

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