sed -e '/abc/d' a.txt > a.log // 删除a.txt中含"abc"的行,将操作之后的结果保存到a.log
sed '/abc/d;/efg/d' a.txt > a.log // 删除含字符串"abc"或“efg"的行,将结果保存到a.log
#!/bin/bash
IFS="
"
while read -r line
do
if [ "DROP TABLE" = ${line:0:10} ];
then
echo $line >>/home/test//test2.sql
fi
done <./1.sql
##删除1.sql中含有指定字符串DROP TABLE的行,并将结果输出到2.sql
##sed -e "/DROP TABLE/d" 1.sql >./2.sql