I have a script (script1.sh) in a unix machine that calls a other script (script2.sh) in other unix remote machine:
ssh user@machine /opt/.../script2.sh param1 param2
There is a trust relationship between both machines.
If I run the script2, it works correctly, but if I run the script1, it calls script2 but JAVA_HOME of script2 is lost. I know that I can fix by "set JAVA_HOME" in script2 but I prefer other solution that I don´t have to put the specific path of JAVA_HOME in each scripts that is called by script1 (script2, script3,...)
Any idea?
Regards.