怎么通过你shell脚本删除文件的某一行以及后面几行

如题所述

第1个回答  2019-11-25
#!/bin/sh
myfile=test.txt
startLine=3
lineCnt=4
let endLine="startLine + lineCnt - 1"
sed -i $startLine','$endLine'd' $myfilestartLine
表示开始行的行号
lineCnt
表示总共要删除的行数
相似回答