Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!hplabs!hpcc05!hpcc01!okamoto From: okamoto@hpcc01.HP.COM (Jeff Okamoto) Newsgroups: comp.lang.perl Subject: Re: Questions about exec and scripts called from cron Message-ID: <1180004@hpcc01.HP.COM> Date: 2 Oct 90 18:05:47 GMT References: <1180002@hpcc01.HP.COM> Organization: HP Corp Computing & Services Lines: 35 lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) says: > Cron could conceivably be feeding the text above to /bin/sh through > stdin, in which case $0 isn't going to be meaningful, and you'd > probably try to execute the first argument of $*. I suspect this is exactly what is happening. Perhaps cron checks the file type and only force-feeds through sh if it isn't a legitimate executable? > If the arguments you're passing contain any whitespace, you should > instead use > eval 'exec /usr/local/bin/perl -S $0 "${1+$@}"' > if $running_under_some_shell; Fortunately, my arguments are vanilla, but I'll remember this. Perhaps this should become the new standard for non-#! machines? As for the original problem, I've tried all the following cron entries and not only do they not work correctly, but they all give me the same error message from cron: 40 10 * * * * /usr/staff/bin/identck.pl 40 10 * * * * /usr/local/bin/perl /usr/staff/bin/identck.pl 40 10 * * * * /usr/local/bin/perl < /usr/staff/bin/identck.pl I've also tried removing the eval/exec (since my machine does understand #!) and that still doesn't work.... -- \ oo The New Number Who, \____|\mm Jeff Okamoto //_//\ \_\ HP Corporate Computing & Services /K-9/ \/_/ okamoto@ranma.corp.hp.com /___/_____\ ----------- (415) 857-6236