Created
July 26, 2011 12:38
-
-
Save macieksk/1106656 to your computer and use it in GitHub Desktop.
dmesg messages time retrieval (hours or minutes ago)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Usage: dmesg | grep eth3 | dmesg_time.sh | |
for time in $(egrep -o '[0-9]+\.[0-9]+') | |
do | |
TIME="`echo "($(awk '{print $1}' /proc/uptime) - $time) / 60 / 60" | bc`h" # Hours | |
TIME="$TIME or `echo "($(awk '{print $1}' /proc/uptime) - $time) / 60" | bc`m" # Minutes | |
echo "$TIME ago" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
after
http://www.digitalprognosis.com/linuxtips/timestamping-linux-kernel-printk-output-in-dmesg-for-fun-and-profit/