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


in reply to add text to each line of a file

What about
ypcat passwd | perl -F: -lane 'print "$F[0]\@domain.local"' > oneliner +.out
? :-)

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

Replies are listed 'Best First'.
Re^2: add text to each line of a file
by ambrus (Abbot) on Mar 10, 2005 at 22:07 UTC
    Why chomp? I belive the -l option chomps the line automatically. (See perlrun.)
      You're absolutely right! I hardly ever use -n or -p, so I forgot about the "other" effect of -l. Thanks!

      thor

      Feel the white light, the light within
      Be your own disciple, fan the sparks of will
      For all of us waiting, your kingdom will come