making a variable for the shell
Mikkel L. Ellertson
mikkel at infinity-ltd.com
Sun Apr 15 15:24:00 UTC 2007
Manuel Arostegui Ramirez wrote:
> El Domingo, 15 de Abril de 2007 01:22, Mikkel L. Ellertson escribió:
>> Scott Berry wrote:
>>> Okay thanks much. I have the cron job set up under /home/Cron Scripts
>>> so this should work.
>> One thing to keep in mind is that the changes posted here are NOT
>> going to affect the path a cron job uses. If you want a cron job to
>> use a path other then the default path, you have to specify it in
>> the cron job.
>>
>> PATH=<the path you want>
>>
>> Mikkel
>
> This is even worse if we talk about the security of the system.
> I would like to believe he's knowing how risky his system is becoming to...
>
It depends on what you set the path to.
PATH=/sbin:/bin:/usr/sbin:/usr/bin
or
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
Then again, I tend to like specifying the exact path to the program,
instead of relying on the PATH settings. Ether set a shell variable
at the start of the script specifying the full path and program to
use, or give the full pathname when using hte command.
AWK=/bin/awk
...
USERS=$($AWK -F: '{print $1}' /etc/passwd)
or
USERS=$(/bin/awk -F: '{print $1}' /etc/passwd)
Mikkel
--
Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!
More information about the fedora-list
mailing list