Missing newline character?

后端 未结 1 1098
抹茶落季
抹茶落季 2021-01-22 05:48

I\'ve copied a file from HDFS into my local file system (all on RH linux). However, after the copy, if I cat the file, I see the following:

[me@ac12         


        
相关标签:
1条回答
  • 2021-01-22 06:06

    You can use this sed to add a newline after last line:

    sed -i.bak $'$s/$/\\n/' file_copy
    

    EDIT:

    Or else use (thanks to @JonathanLeffler):

    echo '' >> file_copy
    
    0 讨论(0)
提交回复
热议问题