2

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
MOHAMED
  • 35,883
  • 48
  • 140
  • 238

1 Answers1

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.

Celada
  • 20,176
  • 3
  • 55
  • 70