#!/bin/csh -f
#
# Shell script to run a ve command file.  Honors COUNTRY and
# PASSWORD variables if set, prompts if not.  Automatically
# updates map files after execution of commands.  Assumes
# area #0 is your entire country.
#
# Usage is 'emprun ve_file', from within your empire data directory.
#
if (! $?COUNTRY) then
    echo -n "Country: "
    setenv COUNTRY $<
endif
#
if (! $?PASSWORD) then
    echo -n "Password: "
    stty -echo
    setenv PASSWORD $<
    stty echo
endif
echo "map" >! mapout
echo "cen" >! cenout
echo "com" >! comout
echo "ship" >! shipout
empire $COUNTRY << EOI
$PASSWORD
`/bin/cat $*`
map #0 >> mapout
cen #0 >> cenout
com #0 >> comout
ship >> shipout
quit
EOI
