From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,2a7d8c271637422 X-Google-Attributes: gidfee84,public From: jgd@alpha3.csd.uwm.edu (John G Dobnick) Subject: Re: Mysterious cron output Date: 1999/07/13 Message-ID: <7mfo51$foe$1@uwm.edu>#1/1 X-Deja-AN: 500559805 References: <378ad4c8.4200909@netnews.worldnet.att.net> Organization: University of Wisconsin - Milwaukee Reply-To: jgd@alpha3.csd.uwm.edu Newsgroups: comp.unix.osf.osf1 Originator: jgd@alpha3.csd.uwm.edu >>I recently took over a couple of Digital systems, both 3.2G and 4.0D, >>which for some reason sends messages from crontab jobs to root, like >>this: >> [.. snip...] >> >>The line in cron is as follows: >> >>00,10,20,30,40,50 * * * * /usr/local/bin/supervision >> >>/var/tmp/supervision/supervision.log 2>&1 >> >>Can something in the script being run override the redirection? Or how >>can I get mail with this redirection? Can something in the setup of cron >>change this? Shells process redirection in the order encountered (or at least /bin/sh does so). Thus... you redirect standard output to the file, and _then_ redirect the STDERR stream back to the STDOUT stream -- which is still the original STDOUT -- namely your "terminal", _not_ the redirected stream. Try doing the "2>&1" before the ">>" and see what happens. It works for me. -- John G Dobnick "Knowing how things work is the basis Information & Media Technologies for appreciation, and is thus a University of Wisconsin - Milwaukee source of civilized delight." jgd@csd.uwm.edu ATTnet: (414) 229-5727 -- William Safire