#!/bin/csh -f
#
# launch: missile launching facility
#  usage: launch missiles
#
if ("$*" != missiles) then
  errecho launch: usage: launch missiles
  exit 1
endif

echo -n "Are you sure [y/n]: "

set response="$<"
if ("$response" == n) then
  errecho Launch abandoned.
  exit 1
else if ("$response" != y) then
  errecho "Launch sequence aborted (cannot interpret $response)."
  exit 1
endif

echo -n "Are you really sure [y/n]: "

set response="$<"
if ("$response" == n) then
  errecho Launch abandoned.
  exit 1
else if ("$response" != y) then
  errecho "Launch sequence aborted (cannot interpret $response)."
  exit 1
endif

echo -n "Do you have any lingering doubts [y/n]: "

set response="$<"
if ("$response" == y) then
  errecho Launch abandoned.
  exit 1
else if ("$response" != n) then
  errecho "Launch sequence aborted (cannot interpret $response)."
  exit 1
endif

echo -n "Can you honestly say that, in the light of the present geopolitical situation,\
the philosophy of deterrence and massive retaliation constitutes the most\
cogent and coherent policy response to be taken as a military posture in the\
prevailing circumstances [y/n]: "

set response="$<"
if ("$response" == n) then
  errecho Launch abandoned.
  exit 1
else if ("$response" != y) then
  errecho "Launch sequence aborted (cannot interpret $response)."
  exit 1
endif

sleep 1
echo "Okay, launching missiles....."
sleep 3
# echo "launch: core dumped at `date`" > core
errecho "Bus error (core dumped)"
exit 1
