🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.bugs
1 messages
1 total messages Started by Wade Blomgren Mon, 11 Jan 1993 21:21
csh redirection fails when run under cron
#52
Author: Wade Blomgren
Date: Mon, 11 Jan 1993 21:21
41 lines
2118 bytes
After upgrading to 3.0 I am having a problem with csh scripts run from cron 
with user ids other than root.  The scripts are run, but any redirection
of output from a command WITHIN the script goes to the standard output
of the script, not to the target of the redirection.

For example, the following script (saved in, say, /tmp/script, mode 755):

#! /bin/csh
echo foo > /tmp/bar

run by the following crontab entry:

* * * * * me /tmp/script > /tmp/script.out 2>&1

results in the word "foo" appearing in /tmp/script.out, NOT /tmp/bar.

The same is true for piped output:

cat /etc/hosts | grep localhost > /tmp/bar

will send the entire hosts file to the output of the script, and nothing
goes through the grep or into /tmp/bar.

NOTE: the output files _are created_.  That is to say, in the first
simple example, the file /tmp/bar will exist, but it will be empty.

This behavior does not seem to happen when the cron command is run as
root.  When the script is run from the command line by the user account
it works fine.   Adding additional levels of indirection (script calling
a script) seems to result in all output being lost.

The problem does not occur on a self contained machine in my office but
it does occur on our other machines.  The only significant difference 
between my machine and the failing machines is the failing machines are 
running NIS.  Can anyone else running non-root csh scripts with cron who 
is using NIS (or not) under 3.0 comment?  Am I hallucinating?

Thanks for any input - I will summarize responses.

Wade Blomgren
wade@hobbes.ucsd.edu
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads