I tried to use some scripts which use tail commands on Debian stretch but I got tail: error writing 'standard output': Broken pipe.

Does Debian handle tail and pipe syntax differently?

Thank you in advance,

  • 1
    You probably have the SIGPIPE signal handler set to 'ignore' in your script or in another program calling it (eg. with trap '' PIPE). Don't do that. – mosvy Nov 12 '18 at 0:47
  • I checked the code but it appears there no SIGPIPE. – user977828 Nov 12 '18 at 1:18
  • 1
    Your code, for example tail -c +${index[${contig}]} ${fasta} | awk '$0~/>/{exit}1' specifically breaks the pipe in certain situations -- just to make that clear. If you can't control the SIGPIPE handling, then you may want to rework the code so that it tests for the />/ condition before calling the pipeline. – Jeff Schaller Nov 12 '18 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.