Skip to content

Instantly share code, notes, and snippets.

@kimitoboku
Last active August 29, 2015 14:23
Show Gist options
  • Save kimitoboku/98dc63e4443a12fdcec4 to your computer and use it in GitHub Desktop.
Save kimitoboku/98dc63e4443a12fdcec4 to your computer and use it in GitHub Desktop.
#!/bin/bash
i=0;
tail -f path | awk '{if(list[$1]=="done"){}else if(list[$1] == $4){print $1;list[$1]="done"}else{list[$1] = $4}}' | while read line
do
i=$(( i + 1 ))
echo "$i:$line"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment