Re: mail redirection using batch command

From: Bill Thompson (wht@NEO.RR.COM)
Date: Fri Jan 02 2004 - 20:16:27 EST


Bill,

The mailbox entry comes from the batch command, not from the "xx" command. I
normally use "at now" rather than "batch", but they should work the same.
Try this:

batch >/dev/null 2>&1 <<!!
xx 1>>nohup1 2>>nohup2
!!

The file "nohup1" was empty because the command "xx" did not write anything
to STDOUT. If you use a real command such as "ls" (rather than "xx") the
output will go to nohup1.

HTH

Bill Thompson
Sr UNIX Systems Administrator
The Goodyear Tire & Rubber Co.

Contains Confidential and/or Proprietary Information
May Not Be Copied or Disseminated Without Express Consent of The Goodyear
Tire & Rubber Company.

AIX-L Archives: http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2

----- Original Message -----
From: "Bill Rhode" <Bill.Rhode@SUNGARD.COM>
Newsgroups: bit.listserv.aix-l
To: <aix-l@Princeton.EDU>
Sent: Friday, January 02, 2004 5:47 PM
Subject: mail redirection using batch command

> I am having unexpected results on AIX 5.2 using the batch command as
demo'd
> in this "test" script.../
> batch <<!!
> xx 1>> nohup1 2>> nohup2
> !!
>
> My object is to route stderr and stdout to a disk file instead of to the
> user mailbox. It routes to both however. In the example, the nohup2 file
> contains the message "ksh[4]: xx: not found.". The mailbox output and
> relevent "man at" paragraph are below. Grateful for any input.
>
> MAILBOX ENTRY...
> Received: (from username@localhost) by aixdev2.company.com (AIX5.2/8.11.0
> /8.1
> 1.0) id i02M6Xq18438 for username; Fri, 2 Jan 2004 16:06:33 -0600
> Date: Fri, 2 Jan 2004 16:06:33 -0600
> From: username
> Message-Id: <200401022206.i02M6Xq18438@aixdev2.company.com>
> To: username
>
> cron: Job username.1073081193.b was run.
>
> MAN ENTRY...
> The at command mails you all output from standard output and standard
error
> for
> the scheduled commands, unless you redirect that output. It also writes
the
> job
> number and the scheduled time to standard error.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:26 EDT