Skip to content

Instantly share code, notes, and snippets.

@flagranterror
Created March 7, 2012 16:29
Show Gist options
  • Save flagranterror/1994207 to your computer and use it in GitHub Desktop.
Save flagranterror/1994207 to your computer and use it in GitHub Desktop.
Split dhcpd.leases into a md array of declarations
#!/usr/bin/env ruby
@leases =[]
File.open('dhcpd.leases', 'r').read.gsub(/\n/, '').split('}').each { |lease| @leases << lease.split(';') }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment