Neuroprose update

Jordan B Pollack pollack at cis.ohio-state.edu
Wed Feb 14 13:15:11 EST 1990


Tony Plate & I wrote a script to make life easier for those people who
don't like to ftp and uncompress.  It is enclosed below, and whatever
file you save it in should be made executable.  (e.g. after saving and
editing a file, do a "chmod +x filename" on it.)  It is also stored as
"Getps" in the neuroprose directory, where it will be maintained
and improved.

Also I'd like to take this opportunity to ask those who have stored
postscript files there, or are planning to in the future, to send me
mail with:

1) filename
2) way to contact author
3) single sentence abstract

so I can Cons up an INDEX file.
 
Jordan Pollack                            Assistant Professor
CIS Dept/OSU                              Laboratory for AI Research
2036 Neil Ave                             Email: pollack at cis.ohio-state.edu
Columbus, OH 43210                        Fax/Phone: (614) 292-4890

---------------cut here, save, and chmod +x----------
#!/bin/sh
########################################################################
# usage: getps <FILENAME> <PRINTERFLAGS>
#
# A Script to get, uncompress, and print postscript
# files from the neuroprose directory on cheops.ohio-state.edu
#
# By Tony Plate & Jordan Pollack
########################################################################

if [ "$1" = "" ] ; then
  echo usage: $0 "<filename> <printerflags>"
  echo
  echo The filename must be exactly as it is in the archive, if your
  echo file is not found the first time, look in the file \"ftp.log\" 
  echo for a list of files in the archive.
  echo
  echo The printerflags are used for the optional lpr command that
  echo is executed after the file is retrieved. A common use would
  echo be to use -P to specify a particular postscript printer.
  exit
fi

########################################################################
#  set up script for ftp
########################################################################
cat > .ftp.script <<END
user anonymous neuron
binary
cd pub/neuroprose
ls
get $1 /tmp/$1
quit
END

########################################################################
# Run and delete the script generating a ftp.log file and error
########################################################################
echo Trying ftp, please wait, could take several minutes ...
ftp -n 128.146.8.62 < .ftp.script > ftp.log
rm -f .ftp.script
if [ ! -f /tmp/$1 ] ; then
  echo Failed to get file - please inspect ftp.log for list of available files
  exit
fi

########################################################################
# Uncompress if necessary
########################################################################
echo Retrieved /tmp/$1
case $1 in
  *.Z)
  echo Uncompressing /tmp/$1
  uncompress /tmp/$1
  FILE=`basename $1 .Z`
  ;;
  *)
  FILE=$1
esac

########################################################################
#  query to print file
########################################################################
echo -n "Send /tmp/$FILE to 'lpr $2' (y or n)? "
read x
case $x in
  [yY]*)
  echo Printing /tmp/$FILE
  lpr $2 /tmp/$FILE
  ;;
esac
echo File left in /tmp/$FILE




More information about the Connectionists mailing list