Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Learning the power of working from the LINUX command line, combining multi-purpose Bash commands with Perl. Explained by one of the best RedHat perl programmers.(note: I apreciate all the following wise comments, but read the first paragraph of the first article, where he explains that he is going to do some unreadable code, inscrutable code, and disposable code :)
quote:"...if perl is the magic we brew here, then bash is the cauldron we brew it in")

Two articles:

How I learned to stop worrying and love the command line by Chip Turner, part 1 (http://www.redhat.com/magazine/004feb05/features/bash/)
How I learned to stop worrying and love the command line by Chip Turner, part 2 (http://www.redhat.com/magazine/005mar05/features/perl/)

I hope you'll enjoy it as I did.

There are also other articles that might be used as incentive for further reading about oneliners. One is a nice story writen with the Humphrey Bogart films' fashion but about a perl case. Read this Ben Okopnik (a oneliner expert) story: Perl One-Liner of the Month: The Adventure of the Spicy Blonde(http://www.gacetadelinux.com/es/lg/issue96/okopnik.html). There are also newer 'adventures' at the original LG's site (http://www.linuxgazette.com/node/1090) (NOTE: see also this story... http://linuxgazette.net/issue89/okopnik.html to round all up)

cat /var/log/httpd/access_log | perl -l -a -n -e 'print $F[6]' | sort +| uniq -c | sort -n | tail -10

In reply to [off-site] Bash + Perl oneliners basics by chanio

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-23 13:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found