我有一个包含109行的文件。
我在下面显示的行上执行两项操作。
# Delete line 74
sed -i '74d' Test.txt
# Add the entry to line 109
sed -i "109iThis is the string" Test.txt
[我看到第74行从我的Test.txt中删除,但是由于某些原因,现在我的Test.txt只有108行,我看不到This is the string
被添加到第109行。
我不确定是什么错误。你能帮我吗?
我建议使用:
sed -i "108iThis is the string" Test.txt