Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Answer: What is the simplest way to print a field, as in $3 does in awk

( #120754=categorized answer: print w/ replies, xml ) Need Help??

Q&A > strings > What is the simplest way to print a field, as in $3 does in awk contributed by projekt21

cat /etc/hosts | perl -ne 'print if (split(/\s+/,$_))[1] =~ localhost'

Comment on Answer: What is the simplest way to print a field, as in $3 does in awk
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2016-02-14 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (470 votes), past polls