Sponsored Content
Full Discussion: Possible errors in telnet
Operating Systems Linux Possible errors in telnet Post 302355916 by chakrapani on Thursday 24th of September 2009 05:07:53 AM
Old 09-24-2009
Java my expect script

script called with two parameters host and port

Code:
#!/usr/bin/expect -f
set timeout 3
set HOST [lindex $argv 0]
set PORT [lindex $argv 1]
#$spawn -noecho $env(SHELL)
spawn -noecho "/bin/bash"
send "telnet ${HOST} ${PORT}\r"
expect {
    "Unknown host"
{
 puts "Unknown Host"
exit 1
}

    "Unable to connect" 
    { 
        puts "not connecting" 
        exit 1
    } 
    "Connected to " 
    {
        send -- "\r"
            expect "telnet>"
            send -- "quit\r"
            expect "Connection closed"
            puts "Connecting "
            exit 0
    }
}
send -- ""
exit 1

 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

Help with errors

I am very new to the world of Unix, in the middle of a crash course as I write this due to a system failure for my company. This system went down approximately 24 hours ago due to some apparent thunderstorms that passed through. The problem is that my company, like many others, has laid off... (5 Replies)
Discussion started by: Phaedirean
5 Replies

2. UNIX for Advanced & Expert Users

Adapter Errors and Link Errors

$ errpt | more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION 3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR 3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR B8113DD1 ... (0 Replies)
Discussion started by: mcastill66
0 Replies

3. AIX

Adapter Errors and Link Errors

$ errpt | more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION 3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR 3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR B8113DD1 ... (2 Replies)
Discussion started by: mcastill66
2 Replies

4. Programming

errors....

hi i have written a program to display files in a directory but it doesnt compile on the sun/solaris system.... im using gcc(inbuilt compiler) im generally used to working on a windows environment so maybe im overlookiing something ive added comments to help readability of the program i also... (2 Replies)
Discussion started by: anything2
2 Replies

5. UNIX for Dummies Questions & Answers

Major OS errors/Bash errors help!!!!

Hi all, dummy here.... I have major errors on entering the shell. On login I get: -bash: dircolors: command not found -bash: tr: command not found -bash: fgrep: command not found -bash: grep: command not found -bash: grep: command not found -bash: id: command not found -bash: [: =: unary... (12 Replies)
Discussion started by: wcmmlynn
12 Replies

6. 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

7. HP-UX

telnet remsh rogin errors

hi everybody. can u help please . i have error: getpid: peer died: Error 0 on /var/adm/syslog/syslog.log. what does it means?how can i fix problem? also strange wen i make an rlogin from my affected host to annother one. it demands the password!!!! (0 Replies)
Discussion started by: hmaiida
0 Replies

8. 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

9. 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

10. Shell Programming and Scripting

Telnet errors coming on screen while using snarf command.

Hi Team, I am using one script, It is working fine, the problem is it gives unwanted telnet errors when I am using it. I just want to remove these unwanted errors/info from my screen. bash-3.00$ cat raza_site_temp #!/usr/bin/bash #rj835b IFS="|" REGEX="$*" echo snarf2 -c "show... (1 Reply)
Discussion started by: Raza Ali
1 Replies
lassign(n)						       Tcl Built-In Commands							lassign(n)

__________________________________________________________________________________________________________________________________________________

NAME
lassign - Assign list elements to variables SYNOPSIS
lassign list varName ?varName ...? _________________________________________________________________ DESCRIPTION
This command treats the value list as a list and assigns successive elements from that list to the variables given by the varName arguments in order. If there are more variable names than list elements, the remaining variables are set to the empty string. If there are more list elements than variables, a list of unassigned elements is returned. EXAMPLES
An illustration of how multiple assignment works, and what happens when there are either too few or too many elements. lassign {a b c} x y z ;# Empty return puts $x ;# Prints "a" puts $y ;# Prints "b" puts $z ;# Prints "c" lassign {d e} x y z ;# Empty return puts $x ;# Prints "d" puts $y ;# Prints "e" puts $z ;# Prints "" lassign {f g h i} x y ;# Returns "h i" puts $x ;# Prints "f" puts $y ;# Prints "g" The lassign command has other uses. It can be used to create the analogue of the "shift" command in many shell languages like this: set ::argv [lassign $::argv argumentToReadOff] SEE ALSO
lindex(n), list(n), lset(n), set(n) KEYWORDS
assign, element, list, multiple, set, variable Tcl 8.5 lassign(n)
All times are GMT -4. The time now is 12:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy