|
Space Key in Shell Script
I need my shell script to echo the space key in a telnet session. Here is script as I currently have it:
-----snip-----
#!/bin/bash
(
sleep 2
echo nevermore
sleep 2
echo en
sleep 2
echo chs008
sleep 2
echo "sh run"
sleep 4
echo " "
sleep 4
echo " "
sleep 4
echo " "
sleep 4
echo " "
) | telnet 10.8.1.100
-----snip-----
I am attempting to telnet to a Cisco switch and run the "sh run" command, which fills the screen and you must hit the space key to get the next full screen of data. I am running the script with as follows:
-----snip-----
[josh@seraph:~]$ ./telnet.script | tee tee.out
-----snip-----
This way I can capture the config of the switch. The script sort of works, but seems that it kills the telnet session when it gets to the second 'echo " " '.
Any help appreciated.
Josh
|