[net.sources] New Postnews Shell Script. CSH!

ee173bl (12/02/82)

Subject  : New Postnews Script...
>From     : ee173bl
Newsgroup: net.sources
 
 
enclosed is a new postnews program that I penned (is that the correct word
when in concerns programs??) in retaliation to the old Bourne Shell 
version.
	It works rather quickly, dropping into VI if no file is specified
as input (since all articles should come from an editor) then sends the
new document to inews, with all the data previously entered.

	Pleae note the full word flags for this - I think that they are
terrific - 'no_warning' rather than '-w' and such.  I would be interested
to hear what other people think of this.


				--  Dave  Taylor
				sdcsvax!sdccsu3!ee173bl

				@UCSD  La Jolla Ca

note: I used pnews to post this article!

----------------------------------------------------------------------------
#!/bin/csh -f
#		Pnews - new postnews interface shell script,
#			with slightly more graceful user inputs,
#			and a much easier way to input a file
#			( the default editor is also VI... )
#
#		Dave Taylor		Nov 30th, 1982
#
#  please see the attached doc
#
if ($1 != "no_warning") then
  echo ' '
  echo 'This program posts news to more than just this machine.'
  echo -n 'Are you absolutely sure that you want to do this?  (y/n) :'
  set ans = $<
  if ($ans != "y" & $ans != "yes") exit
endif
echo ' '
echo -n "Title/Subject : "
set title = $<

echo ' '
echo -n "Newsgroup(s)  : "
set ng = $<

if ($2 == "expire" | $1 == "expire") then
  echo ' '
  echo -n "Expiration date?  (RET for default) : "
  set exp = $<
else
  set exp = ''
endif

echo ' '
echo -n "Input file name?  (DEL to leave, RET for new file) : "
set file = $<

echo ' '
echo ' '
if ($file != "") then
  inews -t "$title" -n $ng -e $exp < $file
else
  onintr leave
  echo 'Subject  : '$title > /tmp/article$$
  echo 'From     : '$user >> /tmp/article$$
  echo 'Newsgroup: '$ng >> /tmp/article$$
  echo ' ' >> /tmp/article$$
  echo ' ' >> /tmp/article$$
  vi /tmp/article$$
  echo '1\
        d4\
        wq' | ex /tmp/article$$ > /dev/null

  inews -t "$title" -n $ng -e $exp < /tmp/article$$

leave:
  rm -f /tmp/article$$

endif

--------------------------------------------------------------------------
		doc: use 'nroff -man' to format
--------------------------------------------------------------------------
.TH PNEWS 1 12/2/82
.UC 4
.SH NAME
pnews \- post news to usenet or a local network
.SH SYNOPSIS
.B pnews
[
.B no_warning expire
]
.SH DESCRIPTION
.I pnews
is a convenient interface to the USENET system, and allows 
articles to be posted to a specified newsgroup/groups.
.TP
.B no_warning
\- don't give the 'are you sure you want to do this?' 
message.
.TP
.B expire
\- ask for an expiration date (default is 2 weeks)
.SH USES
.DT
/usr/local/inews	send an article to the system
.SH "SEE ALSO"
INEWS(1)
.SH AUTHOR
Dave Taylor
--------------------------------------------------------------------------