I am currently running a daemon which creates a virtual terminal for testing purposes. Essentially, if I were to interact with it manually, this is what I get.
I would like to write a script that runs those commands for me and outputs the result to the shell. So by running the script, I should see the following in my terminal window:
I have written a script, but it isn't exactly doing what I want.
Unfortunately, the result i get is:
The scripts then terminate. Can anyone give me a hand to get this working?
That allowed me to execute the command "pl". However, I do not wish to allow interaction with the telnet session. I have tried putting exit at the end of the script and it does not work. If i remove the interact command, I can terminate the script, but the command "pl" does not work.
I would also like to suppress all output, and only output the result from the "pl" command.
I have to put together telnet instructions for 100s of hosts for verifying basic connectivity and get output in a neat format.
Problem- If a telnet is hung with message "Trying .... <hostname" due to firewall or routing issue the commands waits for a very long time before it times out and my... (2 Replies)
hi, please help, keep getting this bolded error and look it up and people say
its your environment variable though i tried to set it manually in expect..it run fine if i run it manually but once i run it by cronjob it error below..i tried to comment out ip/login info with *..
logfile::
START... (0 Replies)
Hi All,
I have an Expect script which logs into Cisco switch, performs a show interface command. I want to read a file of ip addresses which will be passed to the expect script.
The script to read the file works, the expect script works on it's own but when i call the 'expect' script from the... (12 Replies)
Dear experts, please help me .
I've found simple EXPECT scripts and all works fine. But I need more automation in error handling and sending list of commands/output logging from multiple remote hosts.
I have 10 hosts, for example:
host1 192.168.1.1 LOGIN1 PASSWORD1
...... ... (2 Replies)
Hello people, I am creating a script that will alert me in an ftp or telnet account on my system expires. FTP part is ok, but when I am entering the 3 script, it stucks. I can see that the script will not close the telnet seession. Can you please check and let me know what I am doing wrong? What if... (7 Replies)
How to automate sftp with out using expect script?
My batch file has the password but it is not taking. Please see below.
I want to use this sftp connection in a loop for pushing new files in a directory one at a time. Hence I can not use an expect script.
bash-2.05$... (5 Replies)
Hi all,
I have written a small expect script which should spawn a telnet session login and execute some commands.
#!/usr/bin/expect -f
spawn telnet $env(IP)
match_max 100000
expect "login:"
send -- "******\n"
expect -exact "Password:"
send -- "****\n"
expect "%"
Now I have got... (2 Replies)
I am using a shell script to telnet into a remote unix server and execute certain commands. But if any command being executed remotely, throws an error, the script just hangs. And the telnet session does not get closed.
I want to be able to close the session and complete the script execution in... (1 Reply)