The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Get real value from real-time systems iBot Complex Event Processing RSS News 0 01-14-2008 02:10 AM
capturing the time stamp to get hours pavan_test UNIX for Dummies Questions & Answers 0 07-24-2006 03:31 PM
capturing the time stamp pavan_test UNIX for Dummies Questions & Answers 4 07-18-2006 02:35 PM
EPOCH to real time? TheEngineer UNIX for Advanced & Expert Users 5 07-18-2006 09:30 AM
log users real time chanfle UNIX for Dummies Questions & Answers 3 03-22-2006 05:31 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-22-2006
wisher115 wisher115 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 18
Question capturing real time

Newbie question:
I wrote korn shell script that lets me connect to a cisco switch thru telnet from sun server. I'm wodering if or what command i would use to capture info that is being sent to standard output when the script is running. Putting part of my script below and results.
#!/bin/ksh
hostn='x.x.x.x xxx'
(echo open $hostname
sleep 1
echo "\r"
sleep 1
echo "\r"
sleep 2
echo "dir disk0:\r"
sleep 1
echo "\r"
sleep 2
) | telnet
exit

Results:

rommon >
rommon >
rommon > dir disk0:
file A
file B
rommon >

Connection closed by foreign host.

What i'm trying to do is capture the files A or B and echo that back into the script. Or if i start booting it up i want to capture an error message in real time. Any ideas would be greatly appreciated. Thanks
  #2 (permalink)  
Old 09-22-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,245
You may find that a co-process give you better control, and allow you to do as you wish with the responses.
  #3 (permalink)  
Old 09-22-2006
wisher115 wisher115 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 18
Could you show me an example? Thanks
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0