Re: how to set timeout for 'read' command

From: nasir (nasir.kamal_at_gmail.com)
Date: 07/07/05


Date: 7 Jul 2005 07:03:16 -0700


Icarus Sparry wrote:

> > I changed it to /dev/tcp/10.100.1.1/29 where tcp/29 is an unused port
> > and no service is running on that. Ideally it should timeout after 15
> > seconds, but I get the following output immediately:
> >
>
> If the host 10.100.1.1 is accessible, then this is the correct behavior.
> The shell will attempt to connect to that TCP port, get an error response,
> and will therefore fail the shell 'read' command. If you remove the
> s>/dev/null on line 9 you will probably get an error message telling you
> this.

No luck, I tried with IP(10.100.1.1) live and Port(29) blocked. And to
dead non responding IP as well. Same behaviour. It should not be the
same. I dont have any problem if the IP do no exist (do not respond at
all) in my original script. The problem I am having is with an IP which
is live/responding but not responding to certain port (in my case
SSH(tcp/22)).

P.S. Mind that I am originally working on SSH or tcp/22 port, the port
29 I am using just for testing to simulate a non-responding
service/port.

thanks.

>
> This is the same as doing
> read fred < /file/name/that/does/not/exist
> It doesn't hang in the read, just in case you later create the file.
>
> You might have to change the 'sh' to 'ksh' on line 4 if your 'sh' and OS
> do not know about /dev/tcp.



Relevant Pages

  • ANNOUNCE: DJGPP port of GNU Make 3.81 uploaded
    ... This is a port of GNU Make 3.81 to MSDOS/DJGPP. ... The are two kind of required djgpp specific changes to the sources: ... of the SHELL Makefile variable is no longer exported automatically. ...
    (comp.os.msdos.djgpp)
  • RE: Port 4662 exploitation
    ... shell, but to get a tcp header and know what services might be running ... arbitrary port is clearly a most valuable find. ... Stay Ahead of the Hacker Curve! ... Security Trends Report from Cenzic ...
    (Pen-Test)
  • Re: Application starting from boot-up
    ... When the application is started manually, this message appears on the Shell ... port, which is the main serial port on the board. ... want to copy in an update (using the cp command from a flash memory stick), ... the usual recommended way to develop an application for a system that has Linux ...
    (comp.os.linux.embedded)
  • Re: Application starting from boot-up
    ... starting it up from the Shell port. ... port, which is the main serial port on the board. ... is started from /etc/init.d/rcS script, then this message does not appear. ... a system that has Linux pre-installed and where I do not want to make any ...
    (comp.os.linux.embedded)
  • Re: IDLED Replacement?
    ... > I'm an OpenBSD V3.7 user, I use 3.7 for my production systems. ... The idled port ... and automatically end shell sessions that have been idle too ... both ksh and bash ...
    (comp.unix.admin)