Hi Team,
I need password prompt between this script .i want to need put password manually. Instead of adding password in script .
Script pause till input password and resume again.
#!/usr/bin/expect
set ip [lindex $argv 0]
spawn telnet $ip
expect "login:"
send "USR\r"
expect "*assword*"
send "pass1\r"
expect "*root*"
.
.
.
send"exit"
Looking for something like this,
read password < /dev/tty
Hello Ganesh,
Not sure if I completly understood your requirement(as you have shown example of expect
but asking us to help for prompting password because expect
is used for NOT to prompt user), but could you please try following and let me know if this helps.
cat ask_details.ksh
echo "Enter user name:"
read USER_NAME
echo "Ask passwod for user:"
read -s PASS
Now when you execute the script following will be output.
./ask_details.ksh
Enter user name:
test
Ask passwod for user:
Thanks,
R. Singh