head     1.1;
branch   ;
access   ;
symbols  AR73A:1.1 DIST1_0:1.1;
locks    ; strict;
comment  @# @;


1.1
date     90.05.25.16.19.52;  author vanharen;  state Rel;
branches ;
next     ;


desc
@C-shell script for starting up the olc_answers browser,
a convenience "command" for users.
@



1.1
log
@Initial revision
@
text
@#!/bin/csh -f
#
# This file is part of the OLC On-Line Consulting System.
# olc_answers: Read the OLC stock answers (for general users)
#
# Copyright (C) 1988,1990 by the Massachusetts Institute of Technology.
# For copying and distribution information, see the file "mit-copyright.h".
#
#	$Source$
#	$Id$
#	$Author$
#
#	Options: -q for quiet startup, with no delay.
#
#	If stock answers aren't attached, attach them.  Start the browser
#	in the top-level topics directory.
#

set magic=/mit/olc-stock/MAGIC			# if !exists, attach
onintr cleanup

if ($1 == "-q") then
  if (! -e $magic) attach -n -r olc-stock
else
  echo "====================================================================="
  echo "Welcome to the OLC Answers browser."
  echo "Copyright (c) 1988,1990 by the Massachusetts Institute of Technology."
  echo "====================================================================="
  echo ""
  echo "Mail comments or suggestions to 'olc-stock'."
  echo ""
  if (! -e $magic) then
	echo -n "Attaching OLC answers filesystem ... "
	attach -n -r olc-stock > /dev/null
	echo "done."
	echo ""
  endif
  if (! -e $magic) then
	echo "Cannot access OLC answers filesystems. Please try again later."
	echo ""
	exit 1
  endif

  echo "To see a browser entry, type its number.  SPACE goes to the next page"
  echo -n "of a menu, and '-' goes back.  "
  echo "The 's' command saves an entry to a file."
  echo "'?' shows a list of commands.  Type 'q' to exit the browser."
  echo ""
  echo -n "Press RETURN to start the browser, or type 'q' to quit: "
  set answer = $<
  if ($answer =~ [qQ]*) goto cleanup
endif

/mit/olc-stock/browser  -r  /mit/olc-stock/stock_answers

cleanup:
onintr					# now, ignore interrupts
if ($1 != "-q") then
  echo ""
  echo "Thanks for using the OLC Answers browser."
endif
exit
@
