3 ms·
Why not use bash internals like /dev/tcp? "nc" is rarely available on a default installions.
by sprash 11y ago
Why not use bash internals like /dev/tcp? "nc" is rarely available on a default installions.
- benwilber0 11y agoMost OSs that I've seen shipping bash explicitly compile it without /dev/tcp support for security reasons. I would say that nc is a far more portable approach.
- marios 11y agoConsidering most OSes ship with python, I usually go with one of the following, depending on the python version installed : python2 -m SimpleHTTPServer or python3 -m http.server
- sprash 11y agoAll machines I have access right now have /dev/tcp support. But only my main machine has nc installed. To make it more portable a wrapper function which uses whatever is available would be appropriate.