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
Disconnecting a telnet session cooldude UNIX for Dummies Questions & Answers 14 12-09-2007 04:21 PM
How to check sqlplus command is successfull or not in HP UX? plaban.rout HP-UX 5 11-20-2007 02:48 AM
Telnet Session to AIX bluebee UNIX for Dummies Questions & Answers 1 08-07-2007 12:19 PM
Telnet Session pathanjalireddy Shell Programming and Scripting 6 04-06-2005 07:41 AM
Telnet session does not expire deepsteptom Shell Programming and Scripting 1 08-03-2004 08:48 AM

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

Join Date: May 2006
Location: Hurdle Mills North Carolina
Posts: 2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
check for successfull telnet session

In either case using ksh or tcl, how can I check that I have a successfule telnet session and am being prompted with a tacacs login prompt ?



DOIT () {
sleep 2
echo "<tacacs name >"
sleep 1
echo "<password>"
echo "en"
sleep 1
echo "<enable password>"
echo "term length 512"
echo "show config"
echo "term length 50"
echo "disable"
echo "exit"
}

while read x
do
clear
DOIT | telnet $x
done

___________________

#!/usr/local/bin/expect --
# log_user 0
spawn telnet
expect "telnet>"
send "open [lindex $argv 0]\n"
expect "e: "
send "[lindex $argv 1]\n"
expect "d: "
send "[lindex $argv 2]\n"
expect ">"
send "ena\n"
expect "d: "
send "<enable password>"
expect "#"
interact
Reply With Quote
Google UNIX.COM
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:59 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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101