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
echo(3XCURSES)						  X/Open Curses Library Functions					    echo(3XCURSES)

NAME
echo, noecho - enable/disable terminal echo SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int echo(void); int noecho(void); DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft- ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined. RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5) SunOS 5.11 5 Jun 2002 echo(3XCURSES)
All times are GMT -4. The time now is 06:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy