Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
oso2k
6 months ago
|
parent
|
context
|
favorite
| on:
TIL: timeout in Bash scripts
Another fun way to test connectivity in pure bash (need a revision from the past 15 years) is
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/google.com/80'
Replace google.com and port 80 with your web or tcp server (ssh too!). The command will error/time out if there isn’t a server listening or you have some firewall/proxy in the way.
halJordan
6 months ago
[–]
Timeout is an external program to bash
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: