定位行问题请教!

定位行问题请教!

在一个文件中,我要匹配到某行,然后替换它下面那行怎么做?或者删除它下面一行?
我可以将匹配的那行的行号从在文本中,然后读入脚本,但它是字符型的,用
sed '${line1}d' filename 会出错。      
刚发了帖子,又查了一些资料,将问题解决了,不过方法很笨。
将要替换的前一样的行号放入文本,然后读入脚本,对行号加1,然后删除该行
read line1
line1=`expr "${line1}" + 1`
sed ''$line1'd' myfile >myfile.tmp      
FYI:
引用:
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=3903 $?=0] ; cat file2
line1
This line will be modified
line3
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=3903 $?=0] ; sed -e '/line1/ { n; s/will be/has been/; }' file2
line1
This line has been modified
line3
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=3903 $?=0] ; bye
      
FYI:
引用:
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=3903 $?=0] ; cat file1
line1
This line will be deleted
line3
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=3903 $?=0] ; sed -e '/line1/ { n; d; }' file1
line1
line3
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=3903 $?=0] ; bye