Equivalent of exec 3<>/dev/tcp/anyaddress.com/80 in ash

孤者浪人 提交于 2021-02-04 19:40:07

问题


In bash the following command open a socket

exec 3<>/dev/tcp/192.168.1.200/8080

In the ash this command does not work. Are there an equivalent of this command for ash?

here after the output error of the command in ash:

-ash: can't create /dev/tcp/192.168.1.200/8080: nonexistent directory

回答1:


No, there is not. The standard POSIX bourne shell doesn't offer this feature.

You may be able to accomplish what you need with socat or nc.

This bash feature is very strange by the way, considering that it pretends that there is a directory called /dev/tcp which does not actually exist.



来源:https://stackoverflow.com/questions/10640369/equivalent-of-exec-3-dev-tcp-anyaddress-com-80-in-ash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!