Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: add text to each line of a file

by thor (Priest)
on Mar 10, 2005 at 19:30 UTC ( #438398=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://438398]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2023-09-22 04:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?