cancel
Showing results for 
Search instead for 
Did you mean: 

Environment variable help

 
SOLVED
Go to solution
subodhbagade
Regular Advisor

Environment variable help

Hi ,

We are having the hp-ux server of version 11.11 and sap application on it.

(1)I have set an Environmental variable “MQSERVER “globally (/etc/profile), I am able to see variable using env command also echo $MQAERVER showing the path correctly.

(2)But user (iface ) not able to see env variable MQSERVER by env command and by using echo $x even after login through session and also tried with different shell ksh/csh.

(3) I have made the entry of env variable with export command in user’s .profile and tried with new session but still no result.

Please suggest what could be the solution in this case.

Thank you kindly.

Regards,
Subodh.

5 REPLIES
Jozef_Novak
Respected Contributor

Re: Environment variable help

Hello,

are there any other scripts executed from the user's .profile file ? Maybe something that is executed after the .profile clears the user's environment.

J.

Re: Environment variable help

ok prove it with some commands:

As root:

echo $MQSERVER

awk -F: ' $1=="iface" { print $7 } ' /etc/passwd

su - iface -c 'echo $MQSERVER'




HTH

Duncan

HTH

Duncan
Ganesan R
Honored Contributor

Re: Environment variable help

Hi,

>>I am able to see variable using env command also echo $MQSERVER showing the path correctly<<

If you are able to see the env variable, and you are a normal user, then iface user also should be able to do unless or until if something is overriding this value in his user profile. check the user profile
Best wishes,

Ganesh.
Steven Schweda
Honored Contributor

Re: Environment variable help

If the problem user is using a C shell, then
changes to his "~/.profile" or "/etc/profile"
may have little effect.

Adding an "echo" command after the command(s)
used to set the variable might tell you if
anyone is actually running the command(s).

> ok prove it [...]

Or even show your actual changes, instead of
trying to describe (vaguely) what you did.
Real evidence is often more helpful than
vague descriptions.
Bart Paulusse
Respected Contributor
Solution

Re: Environment variable help

What is the default shell of user iface?
Setting variables in /etc/profile doesn't help if the user uses C shell.
Please provide output of:

#grep iface /etc/passwd

Try setting the variable in the .profile or (if C shell) .cshrc files in the $HOME directory of user iface.

Remember that the syntax of csh profile is different from the sh profile syntax.

Regards,
Bart