#!/bin/bash # dmesg-diff # Kieran Bingham 2016 # Public Domain # # Strip out Linux Kernel timestamps when performing a diff on two dmesg files # # Initial version as proof-of-concept, but already useful. # This could be extended to parse extra flags for diff for example # Uses bash temporary stream extensions to save creating tempory files # Usage # dmesg-diff file1 file2 FILE1=$1 FILE2=$2 STRIP_TS='s/^\[[[:space:]+[:digit:].]*\]//' # http://stackoverflow.com/questions/15841223/diff-while-ignoring-patterns-within-a-line-but-not-the-entire-line diff -u \ --label=$FILE1 <(sed $STRIP_TS $FILE1) \ --label=$FILE2 <(sed $STRIP_TS $FILE2)