Sponsored Content
Full Discussion: capture in telnet
Top Forums Shell Programming and Scripting capture in telnet Post 302090598 by wisher115 on Tuesday 26th of September 2006 04:38:55 PM
Old 09-26-2006
capture in telnet

I'm trying to capture the files that this command types out, but i'm not able to do it. I'm pipeing everything to the telnet command because if i dont the connection closes. Any suggestions.


#!/bin/ksh

hostn='x.x.x.xx xxxx'
(echo "open $hostn\r"
sleep 3
echo " \r"
sleep 2
(echo "dir disk1:\r"; sleep 3 ; echo "\r") | tee > /usr/autoprog/prod/rob/dump2
echo "\r"
sleep 2
grep -i c12kprp-diag-mz.RELEASE66 < /usr/autoprog/prod/rob/dump2
rcode=$?
echo "$rcode"
sleep 2
echo "dir disk1:\r"
sleep 3
grep -i "size"
rcode=$?
echo "$rcode"
sleep 2
) | telnet &
exit

Results:

rommon 83 >
rommon 83 > <=== It's trying to save it to dump2 file here. Right?
rommon 84 >
rommon 84 > 1

monitor: command "1" not found
rommon 85 > dir disk1:
File size Perms File name
15803788 -rw- c12kprp-diag-mz.RELEASE66
25899492 -rw- c12kprp-p-mz.120-32.S.bin
3009536 -rw- c12k-fpd-pkg.120-32.S.pkg
0 drw- LOST.DIR
3009536 -rw- c12k-fpd-pkg.120-32.S1.pkg
3020288 -rw- c12k-fpd-pkg.120-32.S3.pkg
rommon 86 >
rommon 86 > 1

monitor: command "1" not found
rommon 87 > Connection closed by foreign host.

If i dump the results of file dump2. I get:
% more dump2
dir disk1:
<=== Where's the output????
Smilie
I've tried it without the "tee" and i still just get dir disk1:
Is there a better way of saving a couple of line after "dir disk1:" to maybe a variable to that i can compare it.
Thanks for any help
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

screen capture

I was wondering is there something out there for Solaris 7 for screen capture? Also it would really help if there was some software out there that can record whats happens on the screen for like 10 seconds or how ever long I need it to. I did a search but doesn't seem to be alot out there. (10 Replies)
Discussion started by: merlin
10 Replies

2. UNIX for Advanced & Expert Users

Capture Value from file

I have a file in the following Format Fundid: 100-BankA AccountNumber Balance 1 200 2 300 3 400 FundId:123321-BankB AccountNumber Balance 1 200 3 100 ........... I can have N number of funds. (1 Reply)
Discussion started by: kris01752
1 Replies

3. Shell Programming and Scripting

script to capture

Hi In my production server some user runnig some scripts to get some data. I need a script to capture this user script code. best rds ab (5 Replies)
Discussion started by: aboorkuma
5 Replies

4. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story: I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage. This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies

5. Programming

how to capture OS name using C/C++ code

Hi, I want to know the os name via c/c++ source code.so please help me to do the same. I will appreciate if anyone can provide me the source code. Thanks in advance.. (9 Replies)
Discussion started by: smartgupta
9 Replies

6. UNIX for Dummies Questions & Answers

Automatic logging (capture screen output) of telnet/ssh sessions on a Solaris node

Hi I am working in Solaris 10 and I want to monitor logs for every telnet/ssh session that tries to connect to the server. I need these logs to be generated in a file that I can fetch using ftp. I am a new user and a stepwise detail will be great BR saGGee (3 Replies)
Discussion started by: saggee
3 Replies

7. UNIX for Dummies Questions & Answers

Automatically login in the telnet from present telnet

Hi, I was writing one script which includes to switch to the another telnet automatically from the present telnet server. I was using rlogin but firstly it takes the same user name of the present telnet and secondly it is prompting for the password. But i want to switch to the another telnet... (2 Replies)
Discussion started by: Prateek
2 Replies

8. UNIX for Dummies Questions & Answers

Difference Between Krb5-telnet And Ekrb5-telnet

Hi, I want to know the difference between these two services. Both are under xinetd. Both are used for enabling and disabling Telnet service. So, can somebody please explain me the difference between the two ? Thanks in advance :) (0 Replies)
Discussion started by: kashifsd17
0 Replies

9. Shell Programming and Scripting

Help using telnet to capture log file with autogenerate timestamp

Hello, I'm just joining, and looking for a solution to my problem. I have an app act as server which forward log data using telnet (server). And in my centos machine, act as a telnet client to capture the data, and an application called recorder which readd those log data and to process it then... (4 Replies)
Discussion started by: eddlinux
4 Replies

10. Solaris

Capture PRSTAT

Is there any scripts to capture the process which use more than 5% CPU from prstat output? (9 Replies)
Discussion started by: tharmendran
9 Replies
RXTELNET(1)						    BSD General Commands Manual 					       RXTELNET(1)

NAME
rxtelnet -- start a telnet and forward X-connections. SYNOPSIS
rxtelnet [-l username] [-k] [-t telnet_args] [-x xterm_args] [-K kx_args] [-w term_emulator] [-b telnet_program] [-n] [-v] host [port] DESCRIPTION
The rxtelnet program starts an xterm window with a telnet to host host. From this window you will also be able to run X clients that will be able to connect securely to your X server. If port is given, that port will be used instead of the default. If setting up the X forwarding failes, rxtelnet will still telnet in to the remote host, but without X forwarding. The supported options are: -l Log in on the remote host as user username. -k Disables keep-alives. -t Send telnet_args as arguments to telnet. -x Send xterm_args as arguments to xterm. -X Send kx_args as arguments to kx. -w Use term_emulator instead of xterm. -b Use telnet_program instead of telnet. -n Do not start any terminal emulator. -v Be verbose. EXAMPLE
To login from host foo (where your display is) to host bar, you might do the following. 1. On foo: rxtelnet bar 2. You will get a new window with a telnet to bar. In this window you will be able to start X clients. SEE ALSO
kx(1), rxterm(1), telnet(1), tenletxr(1), kxd(8) KTH_KRB March 7, 2004 KTH_KRB
All times are GMT -4. The time now is 04:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy