From owner-freebsd-questions Fri Oct 25 03:24:25 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id DAA06873 for questions-outgoing; Fri, 25 Oct 1996 03:24:25 -0700 (PDT) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id DAA06836 for ; Fri, 25 Oct 1996 03:24:20 -0700 (PDT) Received: from gatekeeper.barcode.co.il (gatekeeper.barcode.co.il [192.116.93.17]) by who.cdrom.com (8.7.5/8.6.11) with ESMTP id CAA15989 for ; Fri, 25 Oct 1996 02:15:56 -0700 (PDT) Received: (from nadav@localhost) by gatekeeper.barcode.co.il (8.7.5/8.6.12) id LAA00127; Fri, 25 Oct 1996 11:13:38 +0200 (IST) Date: Fri, 25 Oct 1996 11:13:37 +0200 (IST) From: Nadav Eiron To: "Dennis B. Vega" cc: questions@FreeBSD.org Subject: Re: question abou cron In-Reply-To: <32704B29.167EB0E7@jpi.mozcom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk On Fri, 25 Oct 1996, Dennis B. Vega wrote: > I'm using FreeBSD 2.1.0-RELEASE operating system. Recently, I wrote > a c-shell script that is executed by the root's crontab every 10 > minutes. My problem is the cron uses bourne shell in executing the > script even though the SHELL environment in the /etc/crontab is set > to SHELL=/bin/csh. How can I make this script run in the c-shell? > > Thanks in advance! > > Dennis Vega > As the first line of your script, put: #!/bin/csh Scripts that don't have this magic line are always run by sh. This is something that happens no matter how you run the script. The SHELL variable is used to decide on what shell will be used to execute the command you give in the crontab entry, but even csh, when given a script without a magic line, will use sh to run it. The other option (IMHO, less elegant) is have the crontab read: .... /bin/csh script Nadav