Shell Interview Questions and Answers

 

How do we delete all blank lines in a file?

sed '^ [(backslash)011(backslash)040]*$/d' file1
where (backslash)011 is octal equivalent of space and
(backslash)040 is octal equivalent of tab

Posted by:Richards