<?xml version="1.0" encoding="windows-1252"?>
<node id="440268" title="[off-site] Bash + Perl oneliners basics" created="2005-03-17 00:20:27" updated="2005-08-14 22:25:25">
<type id="1980">
snippet</type>
<author id="245320">
chanio</author>
<data>
<field name="doctext">
</field>
<field name="snippetdesc">
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 &lt;i&gt;unreadable code, inscrutable code, and disposable code&lt;/i&gt; :)&lt;br&gt; quote:&lt;i&gt;&lt;b&gt;"...if perl is the magic we brew here, then bash is the cauldron we brew it in"&lt;/b&gt;&lt;/i&gt;)&lt;p&gt;
Two articles:&lt;p&gt;
&lt;a href="http://www.redhat.com/magazine/004feb05/features/bash/"&gt;How I learned to stop worrying and love the command line by Chip Turner, part 1 (http://www.redhat.com/magazine/004feb05/features/bash/)&lt;/a&gt;&lt;br&gt;
&lt;a href="http://www.redhat.com/magazine/005mar05/features/perl/"&gt;How I learned to stop worrying and love the command line by Chip Turner, part 2 (http://www.redhat.com/magazine/005mar05/features/perl/)&lt;/a&gt;&lt;p&gt;
I hope you'll enjoy it as I did.&lt;p&gt;
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: &lt;a href="http://www.gacetadelinux.com/es/lg/issue96/okopnik.html"&gt;Perl One-Liner of the Month: The Adventure of the Spicy Blonde(http://www.gacetadelinux.com/es/lg/issue96/okopnik.html)&lt;/a&gt;. There are also newer 'adventures' at the original LG's site &lt;a href="http://www.linuxgazette.com/node/1090"&gt;(http://www.linuxgazette.com/node/1090)&lt;/a&gt;
(NOTE: see also this story... [http://linuxgazette.net/issue89/okopnik.html] to round all up)</field>
<field name="snippetcode">
&lt;CODE&gt;
cat /var/log/httpd/access_log | perl -l -a -n -e 'print $F[6]' | sort | uniq -c | sort -n | tail -10
&lt;/CODE&gt;</field>
</data>
</node>
