UNIX Programming, Certification, System Administration, Performance Tuning Reference Books
Deleting Blank Lines Using AWK

Many times of output of some packages contain lot of blank lines. You can remove those blank line using awk as follows:

Assume that /tmp/test is the file containing blank lines

cat /tmp/test | awk '$0!~/^$/ {print $0}' > /tmp/test1

mv test1 test

Return to : Unix System Administration Hints and Tips