Skip to content

Instantly share code, notes, and snippets.

@jrockway
Created September 22, 2012 08:25
Show Gist options
  • Save jrockway/3765553 to your computer and use it in GitHub Desktop.
Save jrockway/3765553 to your computer and use it in GitHub Desktop.
make a dot file out of lsmod's output
#!/usr/bin/perl -n
BEGIN { print "digraph modules {\n" }
if(/^([^[:space:]]+).*\s([^[:space:]]+)$/) {
print "# $1 -> $2\n";
for (split /,/,$2) {
print " $1 -> $_;\n";
}
}
END { print "}" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment