I want to execute
expect -c "
spawn ssh user@10.0.0.0
expect \"assword:\"
send \"pass\r\"
interact "
in a new terminal by doing double click in an .sh script.
I tried
#!/bin/bash
commands () {
expect -c "
spawn ssh root@10.0.0.0
expect \"assword:\"
send \"pass\r\"
interact "
$SHELL # keep the terminal open after the previous commands are executed
}
export -f commands
gnome-terminal -e "bash -c 'commands'"
with no luck. Any ideas?