Skip to content

Instantly share code, notes, and snippets.

@GeoffWilliams
Created June 4, 2019 11:27
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 GeoffWilliams/e2923d046dd36d3983f755bebf76b7f6 to your computer and use it in GitHub Desktop.
Save GeoffWilliams/e2923d046dd36d3983f755bebf76b7f6 to your computer and use it in GitHub Desktop.
read some stuff in and use awk to selectively edit inline and normalise spaces
awk '
{if ($0 ~ /^GRUB_CMDLINE_LINUX=/) {gsub("transparent_hugepage=[[:alnum:]]*[[:space:]]?", "", $0) ; gsub("[[:space:]]?\"$", " transparent_hugepage=never\""); print $0 } else {print}}
' < brett.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment