help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: control timeout of exec {fd}</dev/tcp/google.com/8242


From: Kerin Millar
Subject: Re: control timeout of exec {fd}</dev/tcp/google.com/8242
Date: Thu, 16 May 2024 05:54:45 +0100
User-agent: Cyrus-JMAP/3.11.0-alpha0-456-gcd147058c-fm-hotfix-20240509.001-g0aad06e4

On Thu, 16 May 2024, at 3:35 AM, Peng Yu wrote:
> Hi,
>
> When a host is on, but a port is not on, exec commands like the
> following will take some time before it returns. How can I control the
> timeout so that it returns earlier if the port is nonresponsive?
> Thanks.
>
> $ time exec {fd}</dev/tcp/google.com/8242
> -bash: connect: Operation timed out
> -bash: /dev/tcp/google.com/8242: Operation timed out
>
> real    1m15.055s
> user    0m0.001s
> sys    0m0.004s

Your options are as follows.

- use a more capable external utility to set up and interact with sockets
- use a more powerful programming language
- compile and use a modified bash shell

-- 
Kerin Millar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]