Inter-process communication without FIFOs

后端 未结 5 1698
一向
一向 2021-01-31 22:16

Inside a BASH script we can have multiple processes running in background which intercommunicate using named pipes, FIFOs registered on the filesystem. An example of this could

5条回答
  •  一向
    一向 (楼主)
    2021-01-31 23:03

    You could use nc (aka netcat) which allows connecting a script's standard streams to a network socket. Of course it also works on localhost, so you can use it for IPC between scripts. The bonus is the possibility to have scripts running on different hosts, which is not possible with FIFOs (OK, maybe on NFS it is, but that would be rather cumbersome to set up unless you already have the NFS in place).

提交回复
热议问题