Rajesh Fowkar forced the electrons to say:
> How to run .profile just before running a script at a particular time. This
> is needed because I want to set some environment variables which will be
> used by the script which is to be run.
> 
> eg.:
> 30 8 * * * /usr/pf/pfbk
> 
> I want to run .profile from the user pf before running the above script.
> If I put this stuff(setting environment variables) in pfbk script than it is
> not getting executed.

You sure of this? Setting the environment involves calls to export in sh, and
setenv in csh. These should work in the script as well.

Still, if you want to call .profile, then the line

source /usr/pf/.profile 

should do the trick in sh.

BTW, which shell is /bin/sh in SCO Unix? That is the one cron uses to run
commands. If the shebang notation is not supported, then you might have
problems.

Binand

-- 
main(int c,char **v){while(!fork()){strcpy(v[0],tmpnam(0));sleep(1);}}
A program that changes its name and pid every second.
Try this program at your own risk!   ---> Binand <---


-----------------------------------------------------------------------
For information on this and other Linux India mailing lists check out
http://lists.linux-india.org/

Reply via email to