Skip to content

Instantly share code, notes, and snippets.

@HubTou
Created March 3, 2023 16:59
Show Gist options
  • Save HubTou/80485456772d945febc659caaad377f5 to your computer and use it in GitHub Desktop.
Save HubTou/80485456772d945febc659caaad377f5 to your computer and use it in GitHub Desktop.
AWK 1-liner script to print a file till the first empty line
#!/usr/bin/awk -f
# Usage 0: awk '!NF{exit}{print}' file
# Usage 1: print_till_empty_line.awk file
# Usage 2: cat file | print_till_empty_line.awk
NF {exit}
{print}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment