linux shell中如何往所有行尾添加内容

答: sed -i 's/$/yes/' jello.txt

这句话的意思就是在jello.txt文件的所有行尾都添加相同的内容yes,如jello.txt原来的内容为:

no

jello

hello

yellow

那么经过这个命令处理之后就变成了

noyes

jelloyes

helloyes

yellowyes
原文地址:https://www.cnblogs.com/dakewei/p/10725378.html