<(commands ...)
在bash/zsh中将输出的行为变成文件。是否存在POSIX等效命令?
<(commands ...)
在bash/zsh中将输出的行为变成文件。是否存在POSIX等效命令?
mkfifo foo.fifo
## if your "commands" is multiple commands
# { commands ...; } >foo.fifo &
# otherwise, if it's just one
commands ... >foo.fifo &
something_else foo.fifo
是最接近的可用等价物
something_else <( commands ... )
mktemp
的东西来生成一个或多个管道的目录,以免发生冲突(或者只是生成用于管道的名称,因为mkfifo
是原子的)等。实际上,这就是<( ... )
在幕后所做的全部:它只是更健壮的答案的语法糖。 - mtraceur/dev/fd
的平台上,<( ... )
做了后台操作; 它在其中使用了pipe(2)
匿名描述符对。 - Charles Duffymktemp
。要么需要使用仅限于 POSIX shell 行为的重新实现 mktemp
,要么就必须想出某种 hack 方法。 - Mikko Rantalainen