unix – 使用>>可以安全管道几个并行进程的输出到一个文件?

我从网上抓取数据,我有几个进程的我的刮刀并行运行。

我想要每个这些进程的输出结束在同一个文件。只要文本行保持完整,并且不会互相混淆,行的顺序就不重要了。在UNIX中,我可以使用>>管理每个进程的输出到同一个文件。运算符?

不能保证线路保持不变。他们可以混合。

从根据liori的答案搜索我发现this

Write requests of {PIPE_BUF} bytes or less shall not be interleaved with data from other processes doing writes on the same pipe. Writes of greater than {PIPE_BUF} bytes may have data interleaved,on arbitrary boundaries,with writes by other processes,whether or not the O_NONBLOCK flag of the file status flags is set.

因此,长于{PIPE_BUF}字节的行不能保证保持不变。

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...