Skip to main content

I have this code :

HOSTS="host1 host2"
    For hostname in ${HOSTHOSTS} ;
do ssh -tt ${USERNAME}@${hostname} << EOF
HOSTSN="test"
echo ${HOSTSN}
exit
EOF
Done 

The variable HOSTSN is empty, can you tell me why?

  

I have this code :

HOSTS="host1 host2"
    For hostname in ${HOST} ;
do ssh -tt ${USERNAME}@${hostname} << EOF
HOSTSN="test"
echo ${HOSTSN}
exit
EOF
Done 

The variable HOSTSN is empty, can you tell me why?

 

I have this code :

HOSTS="host1 host2"
    For hostname in ${HOSTS} ;
do ssh -tt ${USERNAME}@${hostname} << EOF
HOSTSN="test"
echo ${HOSTSN}
exit
EOF
Done 

The variable HOSTSN is empty, can you tell me why?

 
tags, formatting
Source Link
countermode
  • 7.8k
  • 5
  • 34
  • 59

I have this code :

HOSTS="host1 host2"
    For hostname in ${HOST} ;
do ssh -tt ${USERNAME}@${hostname} << EOF
HOSTSN="test"
echo ${HOSTSN}
exit
EOF
Done 

The variable HOSTSNHOSTSN is empty  , can you tell me why  ?

I have this code :

HOSTS="host1 host2"
    For hostname in ${HOST} ;
do ssh -tt ${USERNAME}@${hostname} << EOF
HOSTSN="test"
echo ${HOSTSN}
exit
EOF
Done 

The variable HOSTSN is empty  , can you tell me why  ?

I have this code :

HOSTS="host1 host2"
    For hostname in ${HOST} ;
do ssh -tt ${USERNAME}@${hostname} << EOF
HOSTSN="test"
echo ${HOSTSN}
exit
EOF
Done 

The variable HOSTSN is empty, can you tell me why?

edited tags
Link
steve
  • 22.4k
  • 5
  • 53
  • 79
added 29 characters in body
Source Link
Issam
  • 113
  • 1
  • 6
Loading
Source Link
Issam
  • 113
  • 1
  • 6
Loading