- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: shell use telnet not work normal....
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2007 09:30 PM
тАО06-11-2007 09:30 PM
shell use telnet not work normal....
The test.sh is use telnet to connect the HP-UX 11.11u server,but it closed while the username echoed.
But,when user telnet command is normal work.
HOW/WHY it happened? Thanks.
------------------------
test.sh
#!/bin/sh
# test.sh
(
sleep 1
echo "info"
sleep 6
echo "abc123"
sleep 1
echo "vt100"
sleep 2
echo "cd ..;pwd"
sleep 2
echo "exit"
) | telnet 192.168.36.21
--------------------------------
% sh ./test.sh
Trying...
Connected to 192.168.36.21.
Escape character is '^]'.
Local flow control on
Telnet TERMINAL-SPEED option ON
Authorized Access Only.
login: info
Password: Connection closed by foreign host.
NORMAL work.
-----------------------------
telnet 192.168.36.21
Trying...
Connected to 192.1168.36.21.
Escape character is '^]'.
Local flow control on
Telnet TERMINAL-SPEED option ON
Authorized Access Only.
login: info
Password:
Please wait...checking for disk quotas
(c)Copyright 1983-2000 Hewlett-Packard Co., All Rights Reserved.
(........)
Authorized Access Only.
TERM = (hp) vt100
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2007 09:47 PM
тАО06-11-2007 09:47 PM
Re: shell use telnet not work normal....
and welcome to the forums !
Please see these earlier threads:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=799710
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=112262
Please read:
http://66.34.90.71/ITRCForumsEtiquette/after.html
Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
on how to reward any useful answers given to your questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2007 10:06 PM
тАО06-11-2007 10:06 PM
Re: shell use telnet not work normal....
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1128490
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1049594
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2007 07:12 PM
тАО06-16-2007 07:12 PM
Re: shell use telnet not work normal....
>sleep 1
>echo "info"
>sleep 6
>echo "abc123"
How about increasing the first sleep to 4 or 5 and after the user name to reduce the sleep value to 1 or 2 - as below:
sleep 5
echo "info"
sleep 1
echo "abc123"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2007 09:46 PM
тАО06-16-2007 09:46 PM
Re: shell use telnet not work normal....
For this kind of thing you'd do much better to use expect rather than try and create a shell script for it:
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.43/
Note all the run time dependencies you also need to install.
HTH
Duncan
I am an HPE Employee