I am trying to retrieve shell variables generated on the remote machine in an ssh session.
echo -n "Enter the raspberry ip address you want to connect:"
read Rasp_id
sshpass -pthe@Donut ssh -oStrictHostKeyChecking=no pi@"$Rasp_id" << 'E7'
#sudo rm -r SoundEye.zip
mac_add=$(ip link show wlan0 | grep link | awk '{print $2}')
timing=$(date)
E7
echo ${mac_add}
echo ${timing}
I have tried to pass variables from the ssh session (which are $mac_add and $timing) in this case, echo it on the local machine. Putting / in front of each variable doesn't help.
echo /${mac_add}
echo /${timing}
Same goes to adding export in front of each variable I want to declare. It doesn't solve the problem as well.