我不能弄清楚&p在下面的脚本中做什么。print -u4
是否意味着传递的任何参数都写在文件描述符4中?
1: $SRVRMGRCMD |&
3: BGPID=$!
4: exec 4>&p
5: exec 5<&p
6: sleep 2
7: # Build a list of Servers
8: print -u4 "list servers show SBLSRVR_NAME"
这些似乎是对协同进程的引用(在ksh或zsh中)。
见https://unix.stackexchange.com/questions/86270/how-do-you-use-the-command-coproc-in-bash
这是什么语言?
如果是bash或shell,它会创建一个文件描述符来存储输出,见这里:
http://www.softpanorama.org/Tools/exec.shtml,特别是这一部分:
exec 3< inputfile # Opens inputfile with file descriptor 3 for reading.
exec 4> outputfile # Opens outputfile with file descriptor 4 for writing.
exec 5<&0 # Makes fd 5 a copy of fd 0 (standard input).
exec 6>&p # Attach fd 6 to co-process.
编辑说:
-un表示将所有输出写入文件描述符n
http://alasir.com/books/bsd/428 - 430. - html