#!/bin/bash
#
# paws - a self-extracting script containing a pawX11 executable
#        together with a few kumac macros and instructions for
#        executing them.
#

if [ -n "$_CONDOR_SCRATCH_DIR" ]; then
   cd $_CONDOR_SCRATCH_DIR
else
   echo Running as an interactive job...
fi

if ! echo $0 | grep -q "^/"; then
   me=`pwd`/$0
else
   me=$0
fi

mkdir sandbox
cd sandbox
sed '1,/^=== my tarball follows below this line ===/d' $me >my.tgz
if [ -s my.tgz ]; then
   tar zxf my.tgz
   ./job.sh $*
   retcode=$?
   cd ..
   rm -rf sandbox
else
   echo "Nothing to do; I return empty-handed."
   retcode = 0
fi
exit $retcode

=== my tarball follows below this line ===
