awk '$0 !~ /foo/ { print $0 } $0 ~ /foo/ { print $0"bar" }' orig > tmp
mv tmp orig

ちっとは頭使えや