我在Quick way to find if a port is open on Linux找到了这个命令。
exec 6<>/dev/tcp/127.0.0.1/445 || echo "No one is listening!"
我是shell脚本的新手。谁能请详细解释一下这个命令的语法?
特别是exec 6<>/dev/tcp/127.0.0.1/445
。 exec也会返回bool值或其他东西(因为||
正在使用?)
非常感谢。
答案 0 :(得分:2)
<>
进行读写的I / O重定向。 见I/O Redirection
6
表示我们将其分配给文件描述符six。 What are file descriptors?
||
执行bash。换句话说,这是else