(echo "abc";echo "def")|awk '/abc/{match($0,"b");print RSTART} !/abc/{print}'