Shell Removing Tabs/Spaces

前端 未结 6 1691
醉酒成梦
醉酒成梦 2021-02-20 18:45

I\'ve used a grep command with sed and cut filters that basically turns my output to something similar to this

    this line 1


    this line 2


    another li         


        
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-20 19:09

    (whateverproducesthisoutput)|sed -E 's/^[[:space:]]+//'|grep -v '^$'
    

    (depending on your sed, you can replace [[:space:]] with \s).

提交回复
热议问题