Hey all, quick question. I need to update the PATH variable on my box for EVERYONE. To do this, I just created a profile.local script and export the path there. Since CRON does not run the profile, it doesn't pick up the new path. Because of this, my scripts can't located the setenv script (which sets my environment for all of my scripts/apps). How can I set it up so that it ALWAYS picks up that path? I was told that a workaround would be to execute my /etc/profile.local in each script. That would work, but it seems clunky. Is this all I've got? Joe ===== Joseph Hobbs Ionic Productions LLC hobbsj@somecrazyfool.com __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com
On Saturday 16 February 2002 03:49 pm, Joseph Hobbs wrote:
I need to update the PATH variable on my box for EVERYONE. To do this, I just created a profile.local script and export the path there.
/etc/profile.local should work.
On Sunday 17 February 2002 08:15 pm, Joshua Lee wrote:
On Saturday 16 February 2002 03:49 pm, Joseph Hobbs wrote:
I need to update the PATH variable on my box for EVERYONE. To do this, I just created a profile.local script and export the path there.
/etc/profile.local should work.
If that doesn't work try putting it in /etc/profile.local; and adding a command to /etc/profile at the end to run /etc/profile.local (I don't have an /etc/profile.local so I'm naively repeating the comment on top of /etc/profile. ;-) ) -- You have a tendency to feel you are superior to most computers.
That would work GREAT, if CRON ran the /etc/profile.
But it doesn't!
/etc/profile contains the following code which makes
your pathing information a bit easier
PATH=/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin
for DIR in ~/bin/$MACHINE ~/bin ; do
test -d $DIR && PATH=$DIR:$PATH
done
The result of this is (echo $PATH):
/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games/bin:/usr/games
Using a test script, I echo'd PATH in my CRON script,
and it looks like this:
/usr/bin:/bin
Any other ideas?
Joe
--- Joshua Lee
On Saturday 16 February 2002 03:49 pm, Joseph Hobbs wrote:
I need to update the PATH variable on my box for EVERYONE. To do this, I just created a
On Sunday 17 February 2002 08:15 pm, Joshua Lee wrote: profile.local
script and export the path there.
/etc/profile.local should work.
If that doesn't work try putting it in /etc/profile.local; and adding a command to /etc/profile at the end to run /etc/profile.local (I don't have an /etc/profile.local so I'm naively repeating the comment on top of /etc/profile. ;-) ) -- You have a tendency to feel you are superior to most computers.
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq and the archives at http://lists.suse.com
===== Joseph Hobbs Ionic Productions LLC hobbsj@somecrazyfool.com __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com
Personally, I see it as a security feature that cron does not behave in the same way as the login shell. If users are not the one submitting the cron jobs, you *could* set the path in the /etc/crontab and run the jobs from there. When I write my scripts, I am cafeful to always use absolute paths, even for mundane things like grep, find and so forth. That way I know exactly what is being called each time. In many scripts, I have files that define "global" variables and I access it from each script as necessary. Also be careful of the phrase "execute my /etc/profile.local in each script". If you executed it, simply by calling the name of the setenv script, the variables would only be valid in that script, but not in the script that called it. Instead, you need to souce the file ". setenv". Further, you do not have the danger that some user changes the order of the paths in .profile, which may end up breaking things. I did UNIX tech support for four years and I had a customer once who changed the order of the PATH. The created there own tool called "sort", which ended up breaking a number of tools. IMHO the tools were bugging since they did not use full paths, but changing the order of the directories was not necessarily a good thing. Regards, jimmo On Saturday 16 February 2002 21:49, Joseph Hobbs wrote:
Hey all, quick question.
I need to update the PATH variable on my box for EVERYONE. To do this, I just created a profile.local script and export the path there.
Since CRON does not run the profile, it doesn't pick up the new path. Because of this, my scripts can't located the setenv script (which sets my environment for all of my scripts/apps).
How can I set it up so that it ALWAYS picks up that path?
I was told that a workaround would be to execute my /etc/profile.local in each script. That would work, but it seems clunky. Is this all I've got?
Joe
===== Joseph Hobbs Ionic Productions LLC hobbsj@somecrazyfool.com
__________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com
-- --------------------------------------- "Science has promised man power...But, as so often happens when people are seduced by promises of power, the price is servitude and impotence. Power is nothing if it is not the power to choose." Joseph Weizenbaum of MIT said in reference to Computers. --------------------------------------- The Great Linux-NT Debate: http://www.jimmo.com/Linux-NT_Debate/index.html --------------------------------------- NOTE: All messages sent to me in response to my posts to newsgroups or forums are subject to reposting.
I agree that everything should be absolute as far as
calling commands is concerened! This script I was
trying to get to was exactly as you specified
(setenv).
To remedy the situation, I just created a link from
the script to one of the two paths that existed in
cron's $PATH info. This allows me to execute the
setenv script from anywhere, without allowing me to
run all of the friggin scripts in that same dir (this
is GOOD).
Joe
--- James Mohr
Personally, I see it as a security feature that cron does not behave in the same way as the login shell. If users are not the one submitting the cron jobs, you *could* set the path in the /etc/crontab and run the jobs from there.
When I write my scripts, I am cafeful to always use absolute paths, even for mundane things like grep, find and so forth. That way I know exactly what is being called each time. In many scripts, I have files that define "global" variables and I access it from each script as necessary. Also be careful of the phrase "execute my /etc/profile.local in each script". If you executed it, simply by calling the name of the setenv script, the variables would only be valid in that script, but not in the script that called it. Instead, you need to souce the file ". setenv".
Further, you do not have the danger that some user changes the order of the paths in .profile, which may end up breaking things. I did UNIX tech support for four years and I had a customer once who changed the order of the PATH. The created there own tool called "sort", which ended up breaking a number of tools. IMHO the tools were bugging since they did not use full paths, but changing the order of the directories was not necessarily a good thing.
Regards,
jimmo
Hey all, quick question.
I need to update the PATH variable on my box for EVERYONE. To do this, I just created a
script and export the path there.
Since CRON does not run the profile, it doesn't
up the new path. Because of this, my scripts can't located the setenv script (which sets my environment for all of my scripts/apps).
How can I set it up so that it ALWAYS picks up
On Saturday 16 February 2002 21:49, Joseph Hobbs wrote: profile.local pick that
path?
I was told that a workaround would be to execute my /etc/profile.local in each script. That would work, but it seems clunky. Is this all I've got?
Joe
===== Joseph Hobbs Ionic Productions LLC hobbsj@somecrazyfool.com
__________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com
-- --------------------------------------- "Science has promised man power...But, as so often happens when people are seduced by promises of power, the price is servitude and impotence. �Power is nothing if it is not the power to choose." Joseph Weizenbaum of MIT said in reference to Computers. --------------------------------------- The Great Linux-NT Debate: http://www.jimmo.com/Linux-NT_Debate/index.html --------------------------------------- NOTE: All messages sent to me in response to my posts to newsgroups or forums are subject to reposting.
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq and the archives at http://lists.suse.com
===== Joseph Hobbs Ionic Productions LLC hobbsj@somecrazyfool.com __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com
On Monday 18 February 2002 08:14 am, Joseph Hobbs wrote:
cron's $PATH info. This allows me to execute the setenv script from anywhere, without allowing me to
Wait a minute, you named a script "setenv"? Are you aware that this is a built-in command of the (commonly used) csh shell?
Yup, I did. I wasn't aware that csh had a built-in
command setenv. Of course, this shouldnt be a big
issue, considering I don't even have csh installed on
my box! (unless it goes by another name)
Joe
--- Joshua Lee
On Monday 18 February 2002 08:14 am, Joseph Hobbs wrote:
cron's $PATH info. This allows me to execute the setenv script from anywhere, without allowing me to
Wait a minute, you named a script "setenv"? Are you aware that this is a built-in command of the (commonly used) csh shell?
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq and the archives at http://lists.suse.com
===== Joseph Hobbs Ionic Productions LLC hobbsj@somecrazyfool.com __________________________________________________ Do You Yahoo!? Got something to say? Say it better with Yahoo! Video Mail http://mail.yahoo.com
On Monday 18 February 2002 11:25 pm, Joseph Hobbs wrote:
Yup, I did. I wasn't aware that csh had a built-in command setenv. Of course, this shouldnt be a big issue, considering I don't even have csh installed on my box! (unless it goes by another name)
It also is in tcsh. It is a *very* significant built-in command of the c shell and clones, it's the command to set an environmental variable or to display all environmental variables. I strongly reccomend changing your program's name...
That was a great idea! regards, jimmo On Monday 18 February 2002 14:14, Joseph Hobbs wrote:
I agree that everything should be absolute as far as calling commands is concerened! This script I was trying to get to was exactly as you specified (setenv).
To remedy the situation, I just created a link from the script to one of the two paths that existed in cron's $PATH info. This allows me to execute the setenv script from anywhere, without allowing me to run all of the friggin scripts in that same dir (this is GOOD).
Joe
--- James Mohr
wrote: Personally, I see it as a security feature that cron does not behave in the same way as the login shell. If users are not the one submitting the cron jobs, you *could* set the path in the /etc/crontab and run the jobs from there.
When I write my scripts, I am cafeful to always use absolute paths, even for mundane things like grep, find and so forth. That way I know exactly what is being called each time. In many scripts, I have files that define "global" variables and I access it from each script as necessary. Also be careful of the phrase "execute my /etc/profile.local in each script". If you executed it, simply by calling the name of the setenv script, the variables would only be valid in that script, but not in the script that called it. Instead, you need to souce the file ". setenv".
Further, you do not have the danger that some user changes the order of the paths in .profile, which may end up breaking things. I did UNIX tech support for four years and I had a customer once who changed the order of the PATH. The created there own tool called "sort", which ended up breaking a number of tools. IMHO the tools were bugging since they did not use full paths, but changing the order of the directories was not necessarily a good thing.
Regards,
jimmo
On Saturday 16 February 2002 21:49, Joseph Hobbs
wrote:
Hey all, quick question.
I need to update the PATH variable on my box for EVERYONE. To do this, I just created a
profile.local
script and export the path there.
Since CRON does not run the profile, it doesn't
pick
up the new path. Because of this, my scripts
can't
located the setenv script (which sets my
environment
for all of my scripts/apps).
How can I set it up so that it ALWAYS picks up
that
path?
I was told that a workaround would be to execute
my
/etc/profile.local in each script. That would
work,
but it seems clunky. Is this all I've got?
Joe
===== Joseph Hobbs Ionic Productions LLC hobbsj@somecrazyfool.com
__________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com
-- --------------------------------------- "Science has promised man power...But, as so often happens when people are seduced by promises of power, the price is servitude and impotence. Power is nothing if it is not the power to choose." Joseph Weizenbaum of MIT said in reference to Computers. --------------------------------------- The Great Linux-NT Debate: http://www.jimmo.com/Linux-NT_Debate/index.html --------------------------------------- NOTE: All messages sent to me in response to my posts to newsgroups or forums are subject to reposting.
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq and the archives at http://lists.suse.com
===== Joseph Hobbs Ionic Productions LLC hobbsj@somecrazyfool.com
__________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com
-- --------------------------------------- "Science has promised man power...But, as so often happens when people are seduced by promises of power, the price is servitude and impotence. Power is nothing if it is not the power to choose." Joseph Weizenbaum of MIT said in reference to Computers. --------------------------------------- The Great Linux-NT Debate: http://www.jimmo.com/Linux-NT_Debate/index.html --------------------------------------- NOTE: All messages sent to me in response to my posts to newsgroups or forums are subject to reposting.
On Monday 18 February 2002 04:03 am, James Mohr wrote:
When I write my scripts, I am cafeful to always use absolute paths, even for mundane things like grep, find and so forth. That way I know exactly what is being called each time. In many scripts, I have files that define
A good idea. You only have to do this once though, see the "hash" command with the -p option. :-) -- Nudists are people who wear one-button suits.
participants (3)
-
James Mohr
-
Joseph Hobbs
-
Joshua Lee