awk '{print "exec DmsPerfDB..UpdateFourGroupSubType "$0" \ngo\n"}' temp.txt | sed "s/a/a/" >>query.sql
结果:
exec DmsPerfDB..UpdateFourGroupSubType NE40E-81|Tunnel0/0/193
go
exec DmsPerfDB..UpdateFourGroupSubType NE40E-81|Tunnel0/0/193
go
exec DmsPerfDB..UpdateFourGroupSubType NE40E-81|Tunnel0/0/193
go
怎么能变为
exec DmsPerfDB..UpdateFourGroupSubType 'NE40E-81|Tunnel0/0/193'
go
exec DmsPerfDB..UpdateFourGroupSubType 'NE40E-81|Tunnel0/0/193'
go
exec DmsPerfDB..UpdateFourGroupSubType 'NE40E-81|Tunnel0/0/193'
go
------解决方案--------------------------------------------------------
awk '{print "exec DmsPerfDB..UpdateFourGroupSubType "'\''"$0"'\''" \ngo\n"}' temp.txt
------解决方案--------------------------------------------------------
sed "s/a/a/" >>query.sql
用这个 刚才我失误了