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-13-2008 10:10 PM
capturing the time stamp to get hours pavan_test UNIX for Dummies Questions & Answers 0 07-24-2006 11:31 AM
capturing the time stamp pavan_test UNIX for Dummies Questions & Answers 4 07-18-2006 10:35 AM
EPOCH to real time? TheEngineer UNIX for Advanced & Expert Users 5 07-18-2006 05:30 AM
log users real time chanfle UNIX for Dummies Questions & Answers 3 03-22-2006 01:31 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-22-2006
Registered User
 

Join Date: Sep 2006
Posts: 18
Stumble this Post!
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-22-2006
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,513
Stumble this Post!
You may find that a co-process give you better control, and allow you to do as you wish with the responses.
Reply With Quote
  #3 (permalink)  
Old 09-22-2006
Registered User
 

Join Date: Sep 2006
Posts: 18
Stumble this Post!
Could you show me an example? Thanks
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0