From owner-freebsd-questions Fri Aug 18 20:32:10 2000 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id 3A08C37B422 for ; Fri, 18 Aug 2000 20:32:06 -0700 (PDT) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=root) by scientia.demon.co.uk with esmtp (Exim 3.16 #1) id 13Pxyi-000AcI-00; Sat, 19 Aug 2000 03:03:20 +0100 Received: (from ben@localhost) by strontium.scientia.demon.co.uk (8.9.3/8.9.3) id DAA49731; Sat, 19 Aug 2000 03:03:20 +0100 (BST) (envelope-from ben) Date: Sat, 19 Aug 2000 03:03:19 +0100 From: Ben Smithurst To: Willem Brown Cc: Nathan Vidican , questions@freebsd.org Subject: Re: /etc/crontab not work? Message-ID: <20000819030319.B58928@strontium.scientia.demon.co.uk> References: <399A89CC.AA704AD6@wmptl.com> <20000817111319.B40744@snoopy.brwn.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000817111319.B40744@snoopy.brwn.org> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Willem Brown wrote: > Cron uses /bin/sh to execute the script like this. > > /bin/sh script If it did that, it would have real trouble with a cron command like * * * * * /bin/ls Try "/bin/sh /bin/ls" at a prompt and see what happens (don't really, take it from me that you'll likely get garbage on your screen or a syntax error with some weird error message). It uses "/bin/sh -c whatever-command-is-there", so that /bin/sh will just call exec() on the perl script, which will work because of the #! line. Assuming the execute bit is set, which it must be if the command works on the command line. If the execute bit wasn't set, then explicitly invoking perl would fix it. If your suggest does fix it, and the execute bit is set, then I don't know what's going on. Since Nathan says there's no output or errors or anything logged, I'm rather confused anyway. > I based this on my interpretation of the following from the crontab(5) man > page, which means that I might be wrong. > > The entire command portion of the line, up to a newline or % char- > acter, will be executed by /bin/sh or by the shell specified in the SHELL > variable of the cronfile. Just a slight misunderstanding, I think. /bin/sh is used, but not in the way you suggest. -- Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D FreeBSD Documentation Project / To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message