Remove blank lines with grep

后端 未结 15 2036
后悔当初
后悔当初 2020-12-22 17:51

I tried grep -v \'^$\' in Linux and that didn\'t work. This file came from a Windows file system.

15条回答
  •  伪装坚强ぢ
    2020-12-22 18:31

    I tried hard, but this seems to work (assuming \r is biting you here):

    printf "\r" | egrep -xv "[[:space:]]*"
    

提交回复
热议问题