.profile line is not working

February 25, 2009 at 05:59:13
Specs: Redhat Linux
We are converting over from AIX to Linux and I have hit a problem with crontab on Linux. On out unix servers we had these three lines
. /etc/profile
. ./.profile

When I try to use this on Linux it kicks out on this . ./.profile lines. Then the script runs with out the correct env loaded.

Does anyone know how to correct this issue?

See More: .profile line is not working

Report •

February 25, 2009 at 07:07:37
First, I don't mean to elaborate on the obvious, but I'm assuming you've loaded the korn shell on your R.H. Linux system.

I'm also assuming you are executing the 3 lines in a script from cron? Executing .profile this way:

. ./.profile

assumes cron the current working directory is the home directory. While it looks like it was true on AIX, but not on R.H.

Try changing to the user's home diretory before executing the .profile line.

Report •
Related Solutions

Ask Question