[EMAIL PROTECTED] wrote:
>
> Hey Scripting Gurus,
>
> I set up a crontab for root to run a script. The script was written for
> bash. I found out that cron runs under sh? When the job kicks off, it can't
> find ifconfig or grep, which are part of the script. Email is sent to root
> "ifconfig : command not found" "grep : command not found". Is it possible to
> make ifconfig and grep "available" to sh? Is it possible to force cron to run
> under bash?
> Does what I am asking make any sense?
> After finally hashing out the script, I never thought I would hit a brick wall
> with cron :-(
You're hitting a wall because cron doesn't run with the same PATH that
you do. You'll need to add something like:
PATH=/usr/sbin:/sbin
to the top of your script file so it will also search in those
directories. The other thing you could do is just give the full path to
all of the executables that you call.
To have cron instead run the job under bash, just include #! /bin/bash
at the top of the script.
--
Steve Philp
Network Administrator
Advance Packaging Corporation
[EMAIL PROTECTED]