"expect" script external variables
#!/bin/sh
HPPASS1="$2"
send_command()
{
echo "spawn ssh [email protected]"
echo 'sleep 1'
echo 'expect "*assword:*"'
echo 'sleep 1'
echo 'send $1'
...
echo 'expect oet'
}
conf_=`send_command "$HPPASS1" | /usr/bin/expect >> temp_log`