File:  [Research Unix] / researchv10no / cmd / netnews / config / postnews.ihcc
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

: '%W%	%G%'
TMP="/usr/tmp"

FILE=''
GROUP=''
OTHER=''
TITLE=''

while [ $# -gt 0 ]
do
	case $1 in
		-t)
			TITLE=$2
			shift
			;;
		-n)
			GROUP=$2
			shift
			;;
		-f)
			FILE=$2
			shift
			;;
		*)
			OTHER="${OTHER} $1"
			;;
	esac
	shift
done

while [ "${TITLE}x" = "x" ]
do
	echo "Title: \c"
	read TITLE
done

if [ "${GROUP}x" = "x" ]
then
	echo "Newsgroups (general): \c"
	read GROUP
	if [ "${GROUP}x" = x ]
	then
		GROUP="general"
	fi
fi

if [ "${FILE}x" != "x" ]
then
	if [ -r ${FILE} ]
	then
		inews -t "${TITLE}" -n ${GROUP} ${OTHER}< $FILE
		exit
	else
		echo "$0: can not read ${FILE}"
		exit 1
	fi
fi

FILE="${TMP}/pn$$"
trap "sleep 1; cp $t $HOME/dead.article ; echo saved in $HOME/dead.article ; rm -f ${FILE}; exit" 0 1 2
touch ${FILE}

${EDITOR:-vi} ${FILE}

if inews -t "${TITLE}" -n ${GROUP} ${OTHER} < ${FILE}
then
	:
else
	if cat ${FILE} >> ${HOME}/dead.news
	then
		echo "Article saved in ${HOME}/dead.news"
	fi
fi

unix.superglobalmegacorp.com

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