Echo File Until a Blank Line Is Reached
May 27, 2023 —
Gregg Szumowski
You can use the awk
program to search and print lines in a file. If you wanted to print a file until the first blank line is reached you can use the following command to do that:
awk '$0 ~ /^$/ {exit;} {print $0;}' somefile.txt