ssh - Problems to get a remote shell variable -


i have problem execution of shell script remote shell.

i can't value of $arq_end.

ssh -t user@machine << 'eossh'  /app/work/leo/returnfilename.sh #this script returns filename like: address_br_recife_20170913.txt arq_end="`/app/work/leo/returnfilename.sh`" eossh  echo $arq_end #returns nothing! expected return: address_br_recife_20170913.txt 

setting variable in subshell isn't visible in parent shell. need set variable directly in parent shell. way pass output of returnfilename.sh through ssh session , parent shell , capture there.

arq_end=$(ssh user@machine /app/work/leo/returnfilename.sh) echo "$arq_end" 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -