Hello,
The following is just for informational purposes, as the problem has been
solved. Thanks to everyone who provided input.
Here's an update on the progress we made creating an automated telnet script
for uClinux. In short, it is now working, but not when using the subshell
parens ( ), only when using the sh -c ' ' as Enrik suggested. This did not
work on the original build, but now works after building uClinux with all of
telnet's options enabled.
sh -c 'sleep 1; echo username; sleep 1; echo pwd; sleep 1; echo "cp file1
file2"; sleep 1; echo exit' | telnet 10.0.0.24
The above works now.
The below still doesn't
(sleep 1; echo username; sleep 1; echo pwd; sleep 1; echo "cp file1 file2";
sleep 1; echo exit) | telnet 10.0.0.24
Regarding the telnet ( subshell ), we made two different uClinux builds. In
one, we added all the Telnet options through BusyBox. In the other, through
Network Services. Each image was tested and seems to function similarly.
The echo command is sending characters now in the subshell, but only one
sleep command executes (the one with the longest delay), and only after all
other commands in the subshell have been executed.
For example, this script:
( sleep 2; echo username; sleep 5; echo pwd; sleep 2 echo "cd /bin" ) |
telnet 10.0.0.24 23
will log onto the server immediately, and without delay send all the echo
commands at once, and then delay a total of 5 seconds then close the telnet
session.
It doesn't matter where the sleep 5; occurs in the subshell, it will always
delay 5 seconds and ignore all other sleep commands, so long as they are
less than 5 seconds. And if you change any of the above sleep commands to
sleep 10;, it will delay 10 seconds, ignoring the rest. So it looks like it
just chooses the longest sleep delay and ignores all others, and executes it
last.
Tom
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev