Hi
I'm trying to run a script " abc.sh" which triggers "use.sh" .
abc.sh is nothing but a "expect" script which provides username and password automatically to the use.sh script.
Please find below the scripts:
#abc.sh
#!/usr/bin/expect -f
exec /root/use.sh
expect "*name*"
send "baddy\r"
expect "*word*"
send "compaq\r"
expect eof
my second script use.sh is placed in /root/ directory..
please find the script below:
#!/bin/sh
echo "Username: "
read u
echo "Password: "
read p
echo "$u --- $p"
When I execute the script abc.sh I get just
Username:
Unless and until I entert it manually it won't proceed ahead. I understand that since now the control is in use.sh , expect is not working. So any workaround for this..??? Please help me out.
Please note that this is just a 4-5 lines script similar to some other script we use in our project. I cannot change anything in "use.sh". I'm free to edit abc.sh.