BASH: Tail follows a file until string isn’t matched

The problem seems pretty easy… for the first look.

# Prepare :>/tmp/output.log (sleep 1s; echo "exit on match" >> /tmp/output.log) & tail -n +0 -f /tmp/output.log | sed '/exit on match/{p;q}'

My first reaction was “Wuuuut?”, because tail isn’t react on SIGPIPE.

Continue reading