Shell script to append text to each file?

后端 未结 5 882
抹茶落季
抹茶落季 2020-12-10 01:16

I have a folder full of text files. I need to append the same block of text to each of them (and of course overwrite the original file).

I was wondering what the co

5条回答
  •  [愿得一人]
    2020-12-10 01:59

    Variant of kurumi's answer:

    sed -i.bak "\$aTEXTTOINSERT" *.txt
    

    For more details, see SED: insert something to the last line?

提交回复
热议问题