[net.sources] batch command for AT&T UNIX PC 7300

amg22@aluxz.UUCP (garcia) (12/09/85)

	I ran across the following shell script which does a nice job
of providing the much missed batch command on the AT&T UNIX PC.  The
original file (below the cut line) is pretty much self explanatory.

	I hope others find it as useful as I do.  I would also be
interested in any feedback on this file or the availability of other
goodies for the PC 7300.

			Gus Garcia
			AT&T Bell Laboratories
			555 Union Blvd
			Allentown, PA  18103

			aluxz!amg22

------------------------- Cut along this line -------------------------
#........................................................................
#:									:
#: batch -- Run a background shell script independent of login status.	:
#:	Copyright 1985 by G.R.A.M. Associates - For the Public Domain	:
#:									:
#:	Usage:	batch [-] [file ...]					:
#:		where:	file	is 0 or more files containing shell	:
#:				scripts 				:
#:			- 	indicates standard input.		:
#:									:
#:	Files:	$HOME/mmddhhmmss (temporary file removed after use)	:
#:									:
#:  G.R.A.M. Associates assumes no responsibility for any use or misuse	:
#: of this program.  Please don't remove this header.			:
#:......................................................................:

FILE=$HOME/`date '+%m%d%H%M%S'`		# Make a unique file name
( cat $* ; echo rm -f $FILE ) > $FILE	# Need a separate process for input
nohup sh -c "sh $FILE 2>&1 | mail $LOGNAME" 2>&1 >/dev/null &	# Run it
echo batch: Executing $FILE		# Let 'em know its running