AWK Solution:
Here we scroll through the input file to check if they have any field. NF is an AWK built-in variable that is set for the number of fields. If the line is empty, then NF is not specified. In this one liner we check if NF is true, i.e. The value is set. If so, we print a line that is implicit in AWK when the template is true.
awk 'NF' INPUT_FILE
SED Solution:
This solution is similar to those mentioned as an answer. As a syntax, we do not print any lines that are empty.
sed -n '/^$/!p' INPUT_FILE
source share