Skip to content

Instantly share code, notes, and snippets.

@nsdrude
Forked from kbingham/dmesg-diff
Created December 29, 2022 16:06
Show Gist options
  • Save nsdrude/af18133e81fa6d51a4e057efa8580297 to your computer and use it in GitHub Desktop.
Save nsdrude/af18133e81fa6d51a4e057efa8580297 to your computer and use it in GitHub Desktop.

Revisions

  1. @kbingham kbingham revised this gist Oct 12, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions dmesg-diff
    Original file line number Diff line number Diff line change
    @@ -19,8 +19,8 @@ FILE2=$2
    STRIP_TS='s/^\[[[:space:]+[:digit:].]*\]//'

    # http://stackoverflow.com/questions/15841223/diff-while-ignoring-patterns-within-a-line-but-not-the-entire-line
    set -x

    diff -u \
    --label=$FILE1 <(sed $STRIP_TS $FILE1) \
    --label=$FILE2 <(sed $STRIP_TS $FILE2)
    --label=$FILE1 <(sed $STRIP_TS $FILE1) \
    --label=$FILE2 <(sed $STRIP_TS $FILE2)

  2. @kbingham kbingham revised this gist Oct 11, 2016. 1 changed file with 14 additions and 2 deletions.
    16 changes: 14 additions & 2 deletions dmesg-diff
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,21 @@
    #!/bin/sh
    #!/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 out the
    STRIP_TS='s/^\[[[:space:]+[:digit:].]*\]//'

    # http://stackoverflow.com/questions/15841223/diff-while-ignoring-patterns-within-a-line-but-not-the-entire-line
  3. @kbingham kbingham created this gist Oct 11, 2016.
    14 changes: 14 additions & 0 deletions dmesg-diff
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/bin/sh

    FILE1=$1
    FILE2=$2

    # Strip out the
    STRIP_TS='s/^\[[[:space:]+[:digit:].]*\]//'

    # http://stackoverflow.com/questions/15841223/diff-while-ignoring-patterns-within-a-line-but-not-the-entire-line
    set -x

    diff -u \
    --label=$FILE1 <(sed $STRIP_TS $FILE1) \
    --label=$FILE2 <(sed $STRIP_TS $FILE2)