Re: making a variable for the shell

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux