#!/bin/bash : > /tmp/hubahuba tail -f /var/log/messages | awk '/unknown/{print $8;fflush()}' | while read line; do if ! grep -q $line /tmp/hubahuba; then echo $line >> /tmp/hubahuba echo found $line fi done