f



How to check if telnet works?

I would like to check programmatically if I can telnet to a Unix box
without errors.

I know an extensive solution would require Expect for analyzing output
but
I am looking for something simple.

0
SQ
8/18/2006 9:23:23 PM
comp.unix.shell 15442 articles. 2 followers. Post Follow

1 Replies
608 Views

Similar Articles

[PageSpeed] 53

2006-08-18, 14:23(-07), SQ:
> I would like to check programmatically if I can telnet to a Unix box
> without errors.
>
> I know an extensive solution would require Expect for analyzing output
> but
> I am looking for something simple.

If you want to verify that you can login with your user and
passwd, then you'll need something like expect.

if 
  HOST=machine USER=me PASS=pass expect -c '
    spawn telnet $env(HOST)
    expect_after timeout {exit 1} eof {exit 1}
    expect {
      "ogin:" {
	send "$env(USER)\r"
	expect assword: {send "$env(PASS)\r"}
      }
      assword: {send "$env(PASS)\r"}
    }
    expect -re {[$#>] }' > /dev/null 2>&1
then
  echo I could login to that machine
fi

Alternatively, you can do:

{
  {
    sleep 5
    echo me
    sleep 2
    echo pass
    sleep 10
  } | telnet machine 2>&1
  echo
} | grep -q '[$#>] '

But that would be less reliable

-- 
St�phane
0
Stephane
8/19/2006 10:15:32 AM
Reply:

Similar Artilces:

web hosting, shell provider, unix shells, bnc shell, ircd provider, shell hosting, bnc shells, irc shells, ircd shells, unix shell account, irc shell, irc, eggdrop shell, irc vps, irc shell, linux vps
http://www.hostrazor.net/ web hosting, shell provider, unix shells, bnc shell, ircd provider, shell hosting, bnc shells, irc shells, ircd shells, unix shell account, irc shell, irc, eggdrop shell, irc vps, irc shell, linux vps -- questo articolo e` stato inviato via web dal servizio gratuito http://www.newsland.it/news segnala gli abusi ad abuse@newsland.it ...

shell scripts to check unix performance
I AM LOOKING FOR A WEBSITE OR SAMPLE SCRIPTS THAT WILL PROVIDE CPU, MEMORY, SWAP PERFOMANCE IN SOLARIS 10. THANKS On Oct 31, 7:41 am, vaed...@gmail.com wrote: > I AM LOOKING FOR A WEBSITE OR SAMPLE SCRIPTS THAT WILL PROVIDE CPU, > MEMORY, SWAP > PERFOMANCE IN SOLARIS 10. THANKS check vmstat, iostat, df, and sar commands cheers yogesh On Oct 31, 2:23 pm, Yogesh Sawant <y.saw...@gmail.com> wrote: > On Oct 31, 7:41 am, vaed...@gmail.com wrote: > > > I AM LOOKING FOR A WEBSITE OR SAMPLE SCRIPTS THAT WILL PROVIDE CPU, > > MEMORY, SWAP > >...

cgi script with unix shell that is not working
Hi , I'm losing my mind Indeed , I'am still with my cgi script and again it is functionning but in a weird way ... Here is a part of my script : if [ $IN_DB_CHOICE = "Y" ] ; then ../dba/User.sh $IN_DB_USER $IN_DB_PASSWD $IN_DB_NAME > $LOGFILE1 else echo "NOOO!" fi As you can imagine , in a normal way IN_DB_CHOICE=Y which make Y=Y but I don't know if it is the web page or something else , but in 75% , the Y <> Y which you can imagine trigger only the "NOOO!" . Anyone who can help ... Regards, Andy ps: my scr...

Telnet from as400 to Unix or Other F keys need to work.
Anyone know how to make it so when you telnet out of and AS300 iseries to a Unix telnet sever, That all the F-Keys work? how to get TN320. Or know of an 3rd party telnet app, again this is emulation FROM an AS400 into a unix host. Thanks Bentley Bear wrote: > Anyone know how to make it so when you telnet out of and AS300 iseries to a > Unix telnet sever, That all the F-Keys work? how to get TN320. Or know of an > 3rd party telnet app, again this is emulation FROM an AS400 into a unix > host. > > Thanks > > If you prompt the telnet command, on a command line type ...

how to exceute shell scripts in unix server(telnet) from java application which is on windows?
Thanx for your valuable information. But i dont have much knowedge regarding struts. I came to know that we can connect to unix telnet ID and execute the scripts from a java application (using Runtime.exec()) which is on windows. Is it possible? if it is please help me how to write with a sample code. I have to connect to telent (unix). Please help me in this issue. thanks and regards, vinay. > Thanx for your valuable information. But i dont have much knowedge > regarding struts. > I came to know that we can connect > to unix telnet ID and execute the scripts from a java appli...

Shell script does not work on solaris (but works on linux) : why ?
Hello, I wrote the following script which gets as parameter a folder name, verifies that it get a folder name as a parameter, creates a folder an cd to it. I want to activate a shell script called myScript.sh by "source myScript.sh parameterName". The reason for "source myScript.sh parameterName" and not ../myScript.sh is that there is a "cd" command in that script and in order that it will remain at that folder it changes directory to after the script finishes, it needed to be activated by source myScript.sh. "source myScript.sh" works on linux. &q...

Check Internet Connection
Hi, I have this code in Access 2003 for checking if an Internet connection is present: (In the code below, "somedomain" represents the web site that is used to check for the update. I have substituted other domains in to test it.) ********************************************************* Private Const FLAG_ICC_FORCE_CONNECTION = &H1 Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" _ (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long Code in the Form_Load Event: If Internet...

can I run unix shell command in the ModelSim shell?
Hi, Just wonder if I can run unix shell command in the Modelsim shell, expecially those time/date command? Thanks. clinton__bill@hotmail.com wrote: > Hi, > Just wonder if I can run unix shell command in the Modelsim shell, > expecially those time/date command? ModelSim uses Tcl as its scripting language so (almost) anything you can do from Tcl can be done in ModelSim. Tcl has a variety of shell and file interaction commands available. Of course, if you want to execute Unix commands, you need to be running on a Unix (or Cygwin) system. Note that Tcl commands are NOT direct...

Same App works fine with Shell connected but not without Shell.
Hi. I've got an odd problem that it would be great if someone could give me a few pointers with as to what might be going wrong / what could be done to correct it. I've got an application that is downloaded over the ethernet to my nodes via Simple FTP. The application uses printfs to send debug to the shell so that the status can be deduced. In the typical development environment, when a shell is launched and connected to the target server from within Tornado, the application works correctly. In a working environment, (same PC, just Tornado not running) exactly the same binary progr...

checking telnet?
Is there someplace you can telnet to to check if your telnet is working properly? Say you can't connect to your favorite site and wonder if it's you or them. -- Ron Hardin rhhardin@mindspring.com On the internet, nobody knows you're a jerk. ...

It works! It works!
Hey folks, Remember I posted some queries a while back about doing manipulations on directory trees and how tricky it was to keep everything consistent? Well, I've got a basic implementation up and running, and I'm proud to say that it works wonderfully. For those that are curious (Mr French?), I might divulge a bit about how it works :-) Many thanks for the help you folks have given me. I'll probably have a few more queries in the fairly near future, but it's great to get something up and running :-) MH. On Wed, 14 Jan 2004 02:16:31 +0000, "Martin Harve...

Shell shell
hello could anyone help me with such problem I would like to have the class in which I will prepare new window to display.. I want to do it as a shell.... How could I return created shell from that class?? many thanks "uzi" <wojciech.ulasW_ytn_I_JTO@op.pl> wrote in message news:dlih8c$1qm$1@news.onet.pl... > hello > > could anyone help me with such problem > > I would like to have the class in which I will prepare new window to > display.. > I want to do it as a shell.... > > How could I return created shell from that class?? "Sh...

telnet via PuTTY hangs, Windows-builtin telnet works
Hello *, Whenever I start a telnet session via PuTTY to my local SMC Barricade Router, it hangs after a random time (no matter if idle or in use). Same thing via telnet from commandline prompt works without problems. Can anyone tell me which settings have to be changed in PuTTY? Best Regards, Andreas. ...

How does shell work?
Hello, I have to write a program that simulates a shell.It reads a line from stdin and it should run whatever that commands says. For example: >echo "This is a string" ;date > file This command will echo "This is a string " and also will create a file date in which the current date will be written. For the moment I need to understand how shell works?I mean when input a command it will fork a process in which it will run the command?What if we have multiple commands? Thanks in advance for your help In article <1160135752.419387.9770@c28g2000cwb.googlegroups.com&...

Web resources about - How to check if telnet works? - comp.unix.shell

Telnet BBS Guide - Main Page
Listings of telnettable bulletin board systems (BBS) throughout the world. The Telnet BBS Guide is your complete listing of over 400 Telnet BBS ...

Telnet - Wikipedia, the free encyclopedia
Telnet is a network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communication facility ...

Mocha Telnet Lite on the App Store on iTunes
Get Mocha Telnet Lite on the App Store. See screenshots and ratings, and read customer reviews.

mRemoteNG your client for RDP, VNC, ICA, SSH, Telnet and more
... your various remote network connections normally requires a host of different tools: Remote Desktop, VNC Client, Citrix ISA, SSH, Telnet, Rlogin ...

Cisco Security Appliances at risk from Telnet bug
Attackers can remotely execute code with system privileges as a result of a known bug in Telnet daemon telnetd

Enable telnet in Windows 8
Here's how you can turn on telnet in Windows 8.

Watch Star Wars in Text via Telnet
... it's not technically an Easter egg, one of the most eye-popping tips in last Sunday's Top 10 Easter eggs post comments was a pointer to a telnet ...

Watch Star Wars Episode IV: A New Hope in ASCII via Telnet
Watch Star Wars Episode IV: A New Hope in ASCII via Telnet

Seagate NAS drives can be hacked through simple Telnet hole
Wireless NAS or Network Attached Storage drives are a terribly convenient way of practically having your own little cloud, whether at home, at ...

Are you running a Telnet server on Windows? Oh thank God. THANK GOD
Microsoft fixes Google's 0-day Windows bug – plus six more. Adobe patches nine Flash flaws It's that time of the month again, when Microsoft ...

Resources last updated: 2/4/2016 4:21:07 PM