Skip to content

Instantly share code, notes, and snippets.

@gnubyexample
Created April 24, 2011 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnubyexample/939931 to your computer and use it in GitHub Desktop.
Save gnubyexample/939931 to your computer and use it in GitHub Desktop.
Awk script to pull out relevant ATI & RADEON entries from a /var/log/Xorg.0.log or similar
# (c) 2011 Gary Wright
# Usage of the works is permitted provided that this instrument is retained with
# the works, so that any entity that uses the works is notified of this instrument.
# You may additionally create derivatives under this license,
# or BSD "new" / Apache 2.0 / Any Free Software Foundation (fsf.org) approved license.
###
# Awk script to pull out relevant ATI & RADEON entries from a /var/log/Xorg.0.log or similar
###
/ATI/ { count["ATI"]++ }
/) ATI/ { count[") ATI"]++ }
/RADEON/ { count["RADEON"]++ }
/) RADEON/ { count[") RADEON"]++ }
/: Modeline/ { count["Modeline"]++; print "Modeline driven by ..."$1 }
/ Default/ { count["Default"]++; print "Default keyword found..."$1"\n" }
END { print "\n"count["ATI"]" lines contain ATI.\nlines really ATI count="count[") ATI"]
print "\n"count["RADEON"]" lines contain RADEON.\nlines really RADEON count="count[") RADEON"] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment