1834602 Members
4020 Online
110069 Solutions
New Discussion

Removing "dot" from PATH

 
SOLVED
Go to solution
Peter Mills_5
Occasional Contributor

Removing "dot" from PATH

I want to remove the dot from the PATH for a cron job. Despite not being in /etc/profile /etc/PATH .profile and no other dot files being sourced it still appears in the PATH. I've tried sh, ksh, and csh, and cannot find out where it is coming from. Any ideas? (HP-UX 10.20,11.00)
2 REPLIES 2
Pete Randall
Outstanding Contributor
Solution

Re: Removing "dot" from PATH

Peter,

Sorry to say that's the way cron works. From the man page for crontab:

"cron supplies a default environment for every shell, defining:

HOME=user's-home-directory
LOGNAME=user's-login-id
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh"


Pete

Pete
John Palmer
Honored Contributor

Re: Removing "dot" from PATH

Hi Peter,

Cron jobs don't by default source any of the files that you mention. The job itself will inherit whatever PATH is set in the cron daemon itself.

You could set PATH to whatever you want and restart cron.

Also check the cron startup script (/sbin/init.d/cron) to see if that sets PATH.

I am assuming that currently, cron jobs have a PATH setting which includes .

Regards,
John