Friends,
I want to write a script. The logic follows
- Script starts
- SSH to Remote Machine and check whether /home/testUser dir is there or not.
- If it is there, am assigning a value to a variable. else not
- If the variable is set, the do the copy from remote machine to my local machine using scp.
Here, i can not get the value of the variable in shell script.
For ex,
ssh -q REMOTE_SERVER "if [ -d /home/testUser ]; then FLAG=YES fi"
echo $FLAG
in the above case, i can not able to print the value "YES"
My doubt is can we get the value of the variable that we set inside SSH?
Thanks in advance