I\'ve shell script as below:
#!/bin/bash echo \"Select the Gateway Server:\" echo \" 1. Gateway 1\" echo \" 2. Gateway 2\" echo \" 3. Gateway 3\" rea
From your shell script:
/mypath/abc $gateway
From your expect script:
#!/usr/bin/expect set gateway [lindex $argv 0]; # Grab the first command line parameter set timeout 3 spawn ssh "james@$gateway" expect "password:" send "TSfdsHhtfs\r"; interact