- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- using ksh or posix sh coprocessor |& with telnet o...
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
Forums
Discussions
Discussions
Discussions
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
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
03-21-2003 01:12 PM
03-21-2003 01:12 PM
HOST=$1
ID=$2
PW=$3
telnet $HOST 2>&1 | tee /tmp/logfile |&
(sleep 1; print -p $ID)
(sleep 1; print -p $PW)
(sleep 1; print -p echo hello)
a="$(sleep 1; read -p | tr -d '\r')"
while [[ "$a" != *hello* ]] ;
do
print [$a]
a="$(sleep 1; read -p | tr -d '\r')"
done
print -p echo exit
Thanks in advance....
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2003 02:00 PM
03-21-2003 02:00 PM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
ksh: set -xv
sh: sh -x -v script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2003 02:03 PM
03-21-2003 02:03 PM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2003 02:04 PM
03-21-2003 02:04 PM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
#!/usr/bin/ksh
#!/usr/bin/sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 01:04 AM
03-24-2003 01:04 AM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
I've seen this problem with 11.11 machines. But somehow now I am not able to reproduce this on the same hp-ux 11.11 machine. Check if this is a problem with patches required.
In any case, I suggest you use something like remsh to do the above. or even expect scripts.
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.37/
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2919237a4bc6d611abdb0090277a778c,00.html
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x9ec691ccb36bd611abdb0090277a778c,00.html
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 06:27 AM
03-24-2003 06:27 AM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
!#/usr/bin/ksh -x
on the first line. I am more inclined to think that patches would solve the problem. I just have not found the correct one yet. If anyone remembers, would really appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 06:30 AM
03-24-2003 06:30 AM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
That first line HAS to be Sh-Bang - like
#!/usr/bin/ksh -x
NOT
!#/usr/bin/ksh -x
Was that just a typo in your last post?
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 06:32 AM
03-24-2003 06:32 AM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
it was a ....
#!/usr/bin/ksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 06:51 AM
03-24-2003 06:51 AM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
I don't know if this will help very much, but my ksh binary has this what string -
# what /usr/bin/ksh
/usr/bin/ksh:
$Revision: B.11.11_LR
Wed Nov 8 19:55:23 PST 2000 $
$ B.11.11_LR Oct 27 2000 00:40:10 $
Version 11/16/88
I ran the following script several times just now -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#!/usr/bin/ksh
cat /var/adm/syslog/syslog.log |&
while read -p line
do
echo $line
done
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
And it worked fine.
Probably you may try to increase some kernel parameters - max_thread_proc is 1024 on this machine.
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 07:04 AM
03-24-2003 07:04 AM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 07:22 AM
03-24-2003 07:22 AM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
=> what /usr/bin/ksh
/usr/bin/ksh:
$Revision: B.11.11_LR
Wed Nov 8 19:55:23 PST 2000 $
$ B.11.11_LR Oct 27 2000 00:40:10 $
Version 11/16/88
The script you wrote also worked on my 11.11
I have exactly the same results you got. I think I might be looking for a telnet patch since when I compared the tusc outputs between a 11 and 11.11. It started being different at the point when the password is about to be entered. I was ablt to enter the login name, but when it prompted for the password, I was getting the following:
Password: Local flow control on
Connection closed by foreign host.
19174: select(2048, 0x40005860, 0x40005760, 0x40005660, NULL) = 1
19174: recv(4, 0x400064f8, 1024, 0) = 0
19174: ioctl(0, TCSETATTRD, 0x7aff09c4) ERR#25 ENOTTY
19174: ioctl(0, TIOCSLTC, 0x40004b30) ERR#25 ENOTTY
19174: ioctl(0, FIONBIO, 0x7aff0a08) ERR#25 ENOTTY
19174: ioctl(1, FIONBIO, 0x7aff0a08) ERR#25 ENOTTY
19174: close(4) = 0
19174: ioctl(0, TCSETATTRD, 0x7aff0a04) ERR#25 ENOTTY
19174: ioctl(0, TIOCSLTC, 0x40004b38) ERR#25 ENOTTY
19174: ioctl(0, FIONBIO, 0x7aff0a48) ERR#25 ENOTTY
19174: ioctl(1, FIONBIO, 0x7aff0a48) ERR#25 ENOTTY
19174: select(2, NULL, 0x7aff09b8, NULL, NULL) = 1
19174: ioctl(0, TCSETATTRD, 0x7aff0a04) ERR#25 ENOTTY
19174: ioctl(0, TIOCSLTC, 0x40004b30) ERR#25 ENOTTY
19174: ioctl(0, FIONBIO, 0x7aff0a48) ERR#25 ENOTTY
19174: ioctl(1, FIONBIO, 0x7aff0a48) ERR#25 ENOTTY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 07:39 AM
03-24-2003 07:39 AM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
I guess that explains it. Your connection got closed and so, the pipe was broken!
I think I might have faced a similar problem in reading a file which was probably not present. what are the errors you get when you run the script actually?
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2003 04:54 AM
03-25-2003 04:54 AM
SolutionThe problem is not 11.11 specific. Instead it applies for 11.00 and 11.11, but was actually introduced by patches.
In fact the fix for JAGab75328 (11.00 PHNE_22159, 11.11 PHNE_23937) introduced it. With this fix the connection is supposed to be dropped if "stty 0" is issued. As a side effect telnetd closes connections when the speed is "0"... unfortunately this is true when telnet's stdin is no tty.
JAGae02032 adresses this incompatibility. It is included in the latest telnetd patches (11.00 PHNE_26096, 11.11 PHNE_24829) and restores the original behaviour, unless telnetd's new "-y" option is used.
Best regards...
Dietmar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2003 06:27 AM
03-25-2003 06:27 AM
Re: using ksh or posix sh coprocessor |& with telnet on HP-UX 11 works but not on 11.11
=) Thanks again....