Skip to content

Instantly share code, notes, and snippets.

@sagax
Last active February 26, 2018 16:04
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 sagax/caa490ebe6fdfd94182aa51f0415cd20 to your computer and use it in GitHub Desktop.
Save sagax/caa490ebe6fdfd94182aa51f0415cd20 to your computer and use it in GitHub Desktop.
zip awk code to one line
{
gsub(/^\s+/, "", $0);
gsub(/\s+=\s+/, "=", $0);
gsub(/if\s+/, "if", $0);
gsub(/\s+\|\|\s+/, "||", $0);
gsub(/\)\s+{/, "){", $0);
gsub(/}\s+/, "}", $0);
gsub(/\s+{/, "{", $0);
gsub(/\s+\(/, "(", $0);
printf("%s", $0);
}
END {
print ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment