.profile of job owner not read

Everything about Control-M agents installation or setup.
Post Reply
User avatar
rombapa
Nouveau
Nouveau
Posts: 24
Joined: 28 Jun 2011 12:00

.profile of job owner not read

Post by rombapa » 16 Feb 2012 2:32

Hi all,

My job consists of the single command:
echo $PATH

Here is the job sysout:

Code: Select all

+ echo /opt_local/crm/bea10/jdk/bin:.:/usr/local/bin:/usr/bin:/usr/sbin
/opt_local/crm/bea10/jdk/bin:.:/usr/local/bin:/usr/bin:/usr/sbin 
Yet when I login on the node as the job owner and execute the same, here is the output:

Code: Select all

$ echo $PATH
.:/usr/local/bin:/usr/bin:/usr/sbin:/opt_local/oracle/product/V10.2.0/bin:/opt_local/crm/bin:/opt_local/crm/ant/apache-ant-1.7.1/bin
Suspecting that .profile (where PATH is defined) was not read, I added the following variable definition under the Set tab:
PRECMD = . $HOME/.profile

Now here is the sysout of my job:

Code: Select all

+ . /opt_local/crm/.profile
+ H
+ stty erase
/tmp/beid-02h0c-00002.sh: H: not found
+ C
+ stty intr
/tmp/beid-02h0c-00002.sh: C: not found
+ set -o vi
/tmp/beid-02h0c-00002.sh: -o: bad option(s)
... and here are the first lines of the job-owner's .profile:

Code: Select all

$ head -6 .profile
# Set terminal settings
stty erase ^H
stty intr ^C

# Set interactive mode
set -o vi
$

Can anyone please explain:
- Why Control-M has problem reading these first lines of .profile?
- Am I right to conclude that the job-owner's .profile is not read?
-- If yes, why?
-- If not, why has the variable PATH different values when read by the job and on the command line?

Thanks very much for your time.

-----------------

Extra info:
- Ctrl-M server is version 6.4.01, running on HP-UX
- The node where the command is executed is a "remote host" (agentless). OS is SunOS.
- The Ctrl-M/agent used is version is 6.4.01. OS of host is HP-UX.

User avatar
rombapa
Nouveau
Nouveau
Posts: 24
Joined: 28 Jun 2011 12:00

Post by rombapa » 22 Feb 2012 12:54

Thanks for your reply chookgate.
I must have made a mistake somewhere because I am unable to reproduce the problem (i.e. "echo $PATH" in job and on command line now produce the same result !!!). Sorry for the inconvenience.

I have however noticed something else:
Forcing the shell to ksh allows me to use the "EXPORT varname = value" syntax in my scheduled scripts, which is invalid for sh.

Thanks for your time.

Post Reply