Set environment variables using SSH

Posted by Kunal on Stack Overflow See other posts from Stack Overflow or by Kunal
Published on 2010-05-24T06:10:16Z Indexed on 2010/05/24 6:21 UTC
Read the original article Hit count: 322

Filed under:
|
|

Hello,

I am trying to execute unix command using SSH from cygwin. My set of command would navigate to a certain directory, source a particular file. Based on the variables sourced from that file, I would try to launch application. But somehow the variables are not getting sourced as echo does not return any values. Could someone let me know what am I missing here

Contents of the environment variables file (myenv) are

export TEST_DATA="DATA1:DATA2"

and I am executing the following command

$ ssh kunal@kspace "ls; cd /disk1/kunal/env; . ./myenv; echo $TEST_DATA; "

© Stack Overflow or respective owner

Related posts about unix

Related posts about shell