sed和awk的一点点总结
时间:2010-09-22 来源:jing494485758
urfile:
a
b
outfile:
a
OK
a=b
sed "/$a/s//OK/" urfile
sed '/'$a'/s//OK/' urfile
sed "/`echo $a`/s//OK/" urfile
sed '/'`echo $a`'/s//OK/' urfile
awk '/a/{print}/'$a'/{print "OK"}' urfile
awk '/a/{print}/'`echo $a`'/{print "OK"}' urfile
a=b
awk 'BEGIN{print "'$a'"}' #echo $a
相关阅读 更多 +