Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site aluxz.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!aluxz!amg22 From: amg22@aluxz.UUCP (garcia) Newsgroups: net.sources,net.micro.att Subject: batch command for AT&T UNIX PC 7300 Message-ID: <287@aluxz.UUCP> Date: Mon, 9-Dec-85 13:12:43 EST Article-I.D.: aluxz.287 Posted: Mon Dec 9 13:12:43 1985 Date-Received: Tue, 10-Dec-85 06:46:42 EST Organization: AT&T Bell Laboratories, Allentown, PA Lines: 38 Xref: watmath net.sources:3963 net.micro.att:740 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