http://qs1969.pair.com?node_id=438438


in reply to Re: add text to each line of a file
in thread add text to each line of a file

Why use awk at all?

ypcat passwd | perl -wne '/:/ and print "$`\@domain.local\n";'
or
ypcat passwd | cut -d: -f1 | sed 's/$/@mydomain.local/'
or
ypcat passwd | sed 's/:.*/@domain.local/'