Skip to content

Instantly share code, notes, and snippets.

@longbai
Last active August 29, 2015 14:04
Show Gist options
  • Save longbai/a70007f8f48ba775de40 to your computer and use it in GitHub Desktop.
Save longbai/a70007f8f48ba775de40 to your computer and use it in GitHub Desktop.
hosts to dnsmasq
awk -F ' ' 'BEGIN{OFS=""}{if ($0 ~ /^#/) {print}else if (length($0)==0){print}else{print "address=/",$2,"/",$1," ",$3}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment