Operating System - HP-UX
1833704 Members
2303 Online
110062 Solutions
New Discussion

how to get the environment variable value using remsh

 
sanwin
Frequent Advisor

how to get the environment variable value using remsh

Hi,
I am trying to execute remsh from hpunix to linux environment. it is working fine for other display commands but not for displaying or using environment variable.

could anyone help me how to access the env variable through remsh.
remsh usstuetl01 -l infa851 -n "echo $LD_LIBRARY_PATH"

This is the one i am trying. Linux is having bash as the default here.

Could anyone help us.

regards,
sanwin
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: how to get the environment variable value using remsh

Shalom,

Read the user profiles

. .bash_profile

This will source the profile and put variables in memory.

You probably want to remesh (terrible insecure tool to use, ssh is better), running a script that will allow you to set and control your environment variables.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
sanwin
Frequent Advisor

Re: how to get the environment variable value using remsh

Thanks for the reply. Actually i am trying to execute powercenter command from hpunix to linux. it throws the following error:
$remsh linuxhost -l infa851 -n /informatica/etlinfa851/PowerCenter8.5.1/server/bin/pmcmd pingservice -sv Int_JDI_Prod851 -d Dom_JDI_Prod851


ERROR:
error while loading shared libraries: libpmasrt.so: cannot open shared object file: No such file or directory

So i doubt that pmcmd requires some env variable setting which itis not able to refer.

Please comment!!

thanks!!

regards,
sanwin.
Matti_Kurkela
Honored Contributor

Re: how to get the environment variable value using remsh

Instead of setting LD_LIBRARY_PATH in Linux, you can add the names of the directories with the necessary libraries to /etc/ld.so.conf file, one directory per line. After editing the file, run the "ldconfig" command.

Linux usually has "bash" as the default shell. Because bash's rules for executing login scripts are a bit strange, it's not easy to set up environment variables for non-interactive shell sessions. (A session is non-interactive when you specify the command to run at the remote host in the remsh command.)

MK
MK
sanwin
Frequent Advisor

Re: how to get the environment variable value using remsh

Thanks Matt!! It helped to some extent. But still not fully getting executed. again it iscomplaining for INFA_HOME variable. i set that the same way. but no use.
ERROR:
FATAL ERROR during initialization:
Error initializing /informatica/pmlocale.bin. Make sure the environment variable INFA_HOME is defined and set to where Informatica products are installed.
Application terminated.


Any comments!!

regards,
sanwin.

sanwin
Frequent Advisor

Re: how to get the environment variable value using remsh

Thanks it worked finally i added the bash profile too in the command.

thanks!!

Dennis Handly
Acclaimed Contributor

Re: how to get the environment variable value using remsh

>remsh usstuetl01 -l infa851 -n "echo $LD_LIBRARY_PATH"

The problem with the above command is that it echoes $LD_LIBRARY_PATH from your current system, not usstuetl01. You need to put that in single quotes or use "\$".