How do I remove the last blank line in Unix?

Đăng Khánh

New member
How do I remove the last blank line in Unix?
Answer
Try ${/^$/d;} this will only match an empty line if it is the last line of the file. I tried it with sed (GNU sed) 4.2. 2 and got all blank lines deleted not only the empty line if it is the last line of the file.
 

Tìm kiếm

Back
Top