sed指定字符串后面添加
2021-12-211、sed -i '$a\要插入的文字' file.txt
2、sed -i "/JAVA_OPT_EXT/a JAVA_OPT=\"\$\{JAVA_OPT\} --add-exports java.base\/jdk.internal.ref=ALL-UNNAMED\"" bin/runbroker.sh
3、sed -i "/upstream api_server/a\\ 插入数据" test.conf
4、参数r:在某行插入文件
# sed -i ‘2 r readfile.txt’ writefile.txt
sed -i “/start/i $(cat read.txt)” write.xml 插入在start前
sed -i “/start/r read.txt” write.xml插入在start后