how to redirect output of multiple commands to one file

前端 未结 3 869
感动是毒
感动是毒 2020-12-15 05:57

i have a bash script, that has the following two commands:

ssh host tail -f /some/file | awk ..... > /some/file &

ssh host tail -f /some/file | grep          


        
3条回答
  •  -上瘾入骨i
    2020-12-15 06:24

    The best answer to this is to probably get rid of the ssh .... | grep ... line, and modify the awk script in the other command to add the functionality you were getting from the grep command...

    That will get rid of any interleaving issues as a bonus side-effect.

提交回复
热议问题