I want to pass the $SPACE variable into an Expect script and get the output and again pass into the shell script.
#!/bin/bash -x
SPACE=$(df -h | awk '{ print $5 }' | grep -v Use |sort -n |tail -1 | cut -d % -f1)
#set user "root"
#set ip "192\.168\.53\.197"
#echo $SPACE
expect<<EOF
spawn ssh "root\@192\.168\.53\.197"
expect "Password:"
send "Karvy123$\r";
expect "prompt"
send "$SPACE\r";
expect "prompt"
EOF