代码: 全选
sed -i '19i @Repository' file
代码: 全选
sed -i '19i\ @Repository' file
写好的脚本是这样子的,用来完成在需要的位置插入一行
代码: 全选
#!/bin/bash
i=`sed -n '/public.*class/=' $1`;
sed -i ${i}i\ @Repository $1;
代码: 全选
sed -i '19i @Repository' file
代码: 全选
sed -i '19i\ @Repository' file
代码: 全选
#!/bin/bash
i=`sed -n '/public.*class/=' $1`;
sed -i ${i}i\ @Repository $1;