我有一个脚本,想要以以下方式运行:
$ myscript < mydata.dat
在myscript
中,我需要将标准输入(STDIN)分叉/管道传输到多个目的地。
#!/usr/bin/env bash
php script1.php > out1
php script2.php > out2
php script3.php > out3
每个人都需要 STDIN 的副本。这是可能的吗?
比如:
# obviously this is broken ...
STDIN | php script1.php > out1
STDIN | php script2.php > out2
STDIN | php script3.php > out3