Shell script to remove new line after numeric string

后端 未结 1 1565
悲&欢浪女
悲&欢浪女 2021-01-23 20:16

I need to write a SHELL Script to remove new line after only after a numeric string? or after string doesn\'t start with number. For example a have a file:

asasa         


        
相关标签:
1条回答
  • 2021-01-23 21:17

    Here you go!

    [jaypal~]$ cat file9
    asasas
    12345
    adab-123
    123
    
    [jaypal~]$ sed '{N;s/\n/ /g}' file9
    asasas 12345
    adab-123 123
    [jaypal~]$ 
    
    0 讨论(0)
提交回复
热议问题