# 先找到指定字符串aaa的行号 row=`grep -w -n "aaa" txt2 | cut -d ":" -f 1` # 将txt1中内容写入txt2中指定行之后 sed -i "${row}r txt1" txt2
shell txt1写入txt2,并放在txt2中指定字符串的后面
原文:https://www.cnblogs.com/ivyharding/p/11265493.html