<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5861681549126071928</id><updated>2012-02-17T06:34:58.137+05:30</updated><category term='Unix'/><category term='screen'/><category term='awk'/><category term='solution'/><category term='Epigram'/><category term='nohup'/><category term='Linux'/><category term='grep'/><category term='perl'/><category term='uniq'/><category term='Apache'/><category term='error'/><category term='sed'/><category term='sort'/><category term='GNOME'/><title type='text'>Just Another Perl Hacker</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-9208323858434077021</id><published>2011-01-05T20:53:00.001+05:30</published><updated>2011-01-05T20:53:07.612+05:30</updated><title type='text'>Sorting techniques in Perl</title><content type='html'>Check out this SlideShare Presentation: &lt;div style="width:425px" id="__ss_6458192"&gt;&lt;strong style="display:block;margin:12px 0 4px"&gt;&lt;a href="http://www.slideshare.net/ysawant/sorting-techniques-in-perl" title="Sorting techniques in Perl"&gt;Sorting techniques in Perl&lt;/a&gt;&lt;/strong&gt;&lt;object id="__sse6458192" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sortingtechniquesinperl-110105085640-phpapp01&amp;stripped_title=sorting-techniques-in-perl&amp;userName=ysawant" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse6458192" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sortingtechniquesinperl-110105085640-phpapp01&amp;stripped_title=sorting-techniques-in-perl&amp;userName=ysawant" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="padding:5px 0 12px"&gt;View more &lt;a href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/ysawant"&gt;Yogesh Sawant&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-9208323858434077021?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/9208323858434077021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=9208323858434077021' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/9208323858434077021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/9208323858434077021'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2011/01/sorting-techniques-in-perl.html' title='Sorting techniques in Perl'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-4547555680614344217</id><published>2010-09-02T12:01:00.003+05:30</published><updated>2010-09-02T12:04:20.807+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Validating numbers in a perl script</title><content type='html'>This morning one of my perlish friends asked me for help.  He had a regular expression that was used for validating a string which contained numbers.  The regex was failing and he wanted to know how to fix it.  The strings he had were "12.3%", "1.25%" and similar.  Numbers in it came from disk space usage, in percentages varying from 0% to 100%  Similar to what we see in the output of df command.&lt;br /&gt;And he wanted to extract the numeric part of it, to be used in numeric calculations.&lt;br /&gt;&lt;br /&gt;His regex was not taking into account that these numbers could have "optional" parts.  They could be "100%", "12%", "0.8%", "0%" and so on.  Here is the regex I gave him.&lt;br /&gt;&lt;br /&gt;[root@sonash5 tmp]# perl -e '$str = "1.23%"; print "matches"  if ($str =~ m/^((\d{1,3})?(\.\d+)?)\s*%$/); print ", and the match is $1 \n"'&lt;br /&gt;matches, and the match is 1.23&lt;br /&gt;[root@sonash5 tmp]#&lt;br /&gt;&lt;br /&gt;Are you thinking, why not just remove the % character from end of the string and use the rest of it as numeric entity?&lt;br /&gt;&lt;br /&gt;That's a bad idea.  What if some machine gives you "75 %"? Or even "75", assuming that they are percentages?  And the string obtained could even be " 34.5%", resulting in the numeric calculations go wrong.  When those string are coming from a source that you don't know, or may vary based on the operating system and the hardware and other things, it is a good idea to validate the string for the numeric pattern that you are looking for.  And if the pattern is found, extract it and use it further.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-4547555680614344217?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/4547555680614344217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=4547555680614344217' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/4547555680614344217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/4547555680614344217'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2010/09/validating-numbers-in-perl-script.html' title='Validating numbers in a perl script'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-1179600674327234929</id><published>2010-05-25T11:01:00.000+05:30</published><updated>2010-05-25T11:03:20.982+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>How do I I find doubled words in a file</title><content type='html'>Noticed that mistake in the title?  Or missed it?  Here's how to catch those in your text files.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;perl -nl -e 'print  if m/\b(\w+)\s+\1/' filename&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Instead if the whole line, you just want to see the line number and the word that is doubled?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;perl -nl -e 'print "$. : $1"  if m/\b(\w+)\s+\1/' filename&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And you want to correct these?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;perl -pi -e 's/\b(\w+)\s+\1/\1/g' filename&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-1179600674327234929?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/1179600674327234929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=1179600674327234929' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/1179600674327234929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/1179600674327234929'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2010/05/how-do-i-i-find-doubled-words-in-file.html' title='How do I I find doubled words in a file'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-2857961509826598132</id><published>2010-05-21T12:34:00.001+05:30</published><updated>2010-05-21T12:41:11.997+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>How do I get difference between two dates that are in yyyy-mm-dd format</title><content type='html'>A few days ago one of my friends asked me - How to get the difference in terms of number of days from two dates stored in yyyy-mm-dd format.  I was in a hurry and told him how to go about, but couldn't show him the exact steps.&lt;br /&gt;&lt;br /&gt;Yesterday I posed this questions to the interns in our company, thinking they would benefit from solving it.  I told them to read the date values from shell environment variables, and use the programming language /tools of their choice to prepare the solution.&lt;br /&gt;&lt;br /&gt;One guy wrote a neat C code to get the answer.  He had to maintain a data structure to store how many days are present in all the months of the year, and also a function to find if the given year is a leap year or not.   That resulted in the code growing to about 100 lines.&lt;br /&gt;&lt;br /&gt;I asked them if they could think of some other approach, and if they were aware of how time is maintained in UNIX systems.&lt;br /&gt;&lt;br /&gt;A perl script that uses package &lt;span style="font-family: courier new;"&gt;Time::Local&lt;/span&gt; makes the task easier to accomplish.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;#!/bin/perl&lt;br /&gt;use strict;&lt;br /&gt;use warnings;&lt;br /&gt;use Time::Local;&lt;br /&gt;&lt;br /&gt;my $date1 =  $ENV{'date1'};&lt;br /&gt;my $date2 =  $ENV{'date2'};&lt;br /&gt;&lt;br /&gt;my @date1_breakup = split(/-/, $date1);&lt;br /&gt;my @date2_breakup = split(/-/, $date2);&lt;br /&gt;&lt;br /&gt;my $date1_unix = timelocal(0, 0, 0, $date1_breakup[2], $date1_breakup[1], $date1_breakup[0]);&lt;br /&gt;my $date2_unix = timelocal(0, 0, 0, $date2_breakup[2], $date2_breakup[1], $date2_breakup[0]);&lt;br /&gt;&lt;br /&gt;my $diffSeconds = $date2_unix - $date1_unix;&lt;br /&gt;my $diffDays = $diffSeconds / (60 * 60 * 24);&lt;br /&gt;print "difference in days : $diffDays\n";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A plain simple bourne shell script can also do the job for us, if the date command supports -d option.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;#/bin/sh&lt;br /&gt;date1_unix=`date -d $date1 +%s`&lt;br /&gt;date2_unix=`date -d $date2 +%s`&lt;br /&gt;diff=`expr $date2_unix - $date1_unix`&lt;br /&gt;diff_days=`expr $diff / 86400`  # Number of seconds in a day are 86400&lt;br /&gt;echo $diff_days&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;yogeshs@yogesh-laptop:~/temp$ export date1=2010-04-22&lt;br /&gt;yogeshs@yogesh-laptop:~/temp$ export date2=2010-05-23&lt;br /&gt;yogeshs@yogesh-laptop:~/temp$ ./date_diff.sh&lt;br /&gt;31&lt;br /&gt;yogeshs@yogesh-laptop:~/temp$&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here's what happened inside the shell script.&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;yogeshs@yogesh-laptop:~/temp$ sh -x date_diff.sh&lt;br /&gt;+ date -d 2010-04-22 +%s&lt;br /&gt;+ date1_unix=1271874600&lt;br /&gt;+ date -d 2010-05-23 +%s&lt;br /&gt;+ date2_unix=1274553000&lt;br /&gt;+ expr 1274553000 - 1271874600&lt;br /&gt;+ diff=2678400&lt;br /&gt;+ expr 2678400 / 86400&lt;br /&gt;+ diff_days=31&lt;br /&gt;+ echo 31&lt;br /&gt;31&lt;br /&gt;yogeshs@yogesh-laptop:~/temp$&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You still want to see how this is done using C?  Do let me know and I'll share that piece of code with you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-2857961509826598132?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/2857961509826598132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=2857961509826598132' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/2857961509826598132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/2857961509826598132'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2010/05/how-do-i-get-difference-between-two.html' title='How do I get difference between two dates that are in yyyy-mm-dd format'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-744917101260083561</id><published>2009-03-25T20:06:00.003+05:30</published><updated>2009-03-25T20:13:28.216+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='GNOME'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>Zenity</title><content type='html'>Its been ten years since I was introduced to UNIX, and there are still so many things to learn.  Today while browsing at my favorite UNIX forums, I saw a question: &lt;span style="font-style: italic;"&gt;help - something doesn't work with zenity&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;I had never heard of zenity, and the question aroused my interest to know what it was about.  After following the rule &lt;span style="font-style: italic;"&gt;do a web search before you ask&lt;/span&gt;, I discovered that zenity was present at my system!  And I didn't knew that.  Poor me.&lt;br /&gt;&lt;br /&gt;I never knew that we could pop up a dialog box from a shell script.  Here's how.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;zenity --info --title "Hi" --window-icon=none --text "Howdy world\!"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A look at the man page and I got answer to &lt;a href="http://www.unix.com/unix-dummies-questions-answers/105357-zenity-question-help.html"&gt;that question&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-744917101260083561?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/744917101260083561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=744917101260083561' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/744917101260083561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/744917101260083561'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2009/03/zenity.html' title='Zenity'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-8045676250439427937</id><published>2008-12-26T23:29:00.004+05:30</published><updated>2008-12-27T09:55:25.999+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='solution'/><title type='text'>Problems galore, Solutions aplenty</title><content type='html'>A few years ago, one of my friends asked me for advice.  He was frustrated, mostly out of his job.  I wanted to help, but he was at the other side of the globe!  I couldn't give him a ready solution.  But instead, I sent him my recepie of solving a problem.  Here it is.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. Identify the problem&lt;/span&gt;&lt;br /&gt;This is the first step.  Unless we identify the exact problem, with all its details, we won't be able to prepare a solution for it.  If you could prepare a &lt;span style="font-style: italic;"&gt;problem statement&lt;/span&gt;, not more than a few lines, that would help much to make things clear.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Make a list of all possible solutions&lt;/span&gt;&lt;br /&gt;When you are aware what the problem is or what is bothering you or what is it that you are not satisfied with, think of all the possible ways in which the situation could be improved.  Even if a solution looks simple, or complex, far fetched, or lengthy, do add it to your list.  Include only practical solutions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. Choose the best solution from the list&lt;/span&gt;&lt;br /&gt;When you know the all possible ways, choose the best one.  Depends on what is &lt;span style="font-style: italic;"&gt;best&lt;/span&gt; for you in that situation.  Choosing the &lt;span style="font-style: italic;"&gt;best&lt;/span&gt; one would require comparisons and judgement on the criteria that you have.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4. Implement the best solution that we now know&lt;/span&gt;&lt;br /&gt;Go ahead, its time for action.&lt;br /&gt;&lt;br /&gt;When I have a problem, I tend to think in this way.  And it works for me.  And who doesn't have problems in this world?  Sometimes I think that we are here to solve problems.  We are all problem-solvers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-8045676250439427937?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/8045676250439427937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=8045676250439427937' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/8045676250439427937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/8045676250439427937'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/12/problems-galore.html' title='Problems galore, Solutions aplenty'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-1872652162068114998</id><published>2008-12-21T14:13:00.009+05:30</published><updated>2008-12-26T23:48:09.631+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='screen'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='nohup'/><title type='text'>screen 'em</title><content type='html'>Some of the tasks that I do involve running commands that take way long to finish - some take a few hours, others take a couple of days.  Obviously, you can't be staring at the terminal till the task is done.  And if you close the terminal, the command dies away.  So how to run these commands?  Simply running them in background won't help, as they would be terminated when you log out.&lt;br /&gt;&lt;br /&gt;One idea is to run them in background, and using &lt;span style="font-family:courier new;"&gt;nohup&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ nohup my_cmd &amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ exit&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This would start the command in the background in such a way that it won't be stopped even if you log out.  But you won't see the output at your terminal.  &lt;span style="font-family:courier new;"&gt;nohup&lt;/span&gt; would redirect it to a file named &lt;span style="font-family:courier new;"&gt;nohup.out&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Once I start the command using nohup, there is no way I can interact with it.  And I can't see the output at the terminal.  Sure, there is a way if I really want to.  Keep watching: $ &lt;span style="font-family:courier new;"&gt;tail -f nohup.out&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A better alternative in these scenarios is to use the GNU Screen utility.  It offers many useful features.&lt;br /&gt;&lt;br /&gt;* I can start the command and leave it alone.  Later, I can see how it is progressing whenever I want to.&lt;br /&gt;&lt;br /&gt;* I can start the command from one computer, and then see how it is progressing from a different computer.  So I can start the task at office, then go home, and when I find time, check how it is going.&lt;br /&gt;&lt;br /&gt;* More than one users can share a screen.  So if my colleague wants to check, he can also connect to the same screen and see the progress.&lt;br /&gt;&lt;br /&gt;* Multiple terminal sessions can be created  in a screen session.  So I can keep running the command in one of them, and do something else in the other.&lt;br /&gt;&lt;br /&gt;* Screen is very helpful when the network connection is unreliable.  I would still have the task running even if connection breaks.&lt;br /&gt;&lt;br /&gt;Enough.  Tel me how do I start.&lt;br /&gt;&lt;br /&gt;Check if a screen session is already running&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ screen -ls&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Attach to a not detached session&lt;br /&gt;$ screen -x&lt;br /&gt;&lt;br /&gt;Start a new screen session&lt;br /&gt;$ screen&lt;br /&gt;&lt;br /&gt;Create a new terminal session&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;CTRL+a c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Toggle between two terminal sessions&lt;br /&gt;CTRL+a CTRL+a&lt;br /&gt;&lt;br /&gt;Go to the &lt;span style="font-style: italic;"&gt;n&lt;/span&gt;th terminal session&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;CTRL+a n&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Send the command character &lt;span style="font-family:courier new;"&gt;CTRL+a&lt;/span&gt; to a window&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;CTRL+a a&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Detach from a screen&lt;br /&gt;CTRL+a d&lt;br /&gt;&lt;br /&gt;Terminate the screen&lt;br /&gt;$ exit&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;man screen&lt;/span&gt; for more information&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-1872652162068114998?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/1872652162068114998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=1872652162068114998' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/1872652162068114998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/1872652162068114998'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/12/screen-em.html' title='screen &apos;em'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-3669367563932741912</id><published>2008-12-20T17:35:00.004+05:30</published><updated>2008-12-20T22:09:51.741+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='error'/><title type='text'>bad command or file name</title><content type='html'>Really?  Is my command so bad?  Then what would a good command look like?&lt;br /&gt;&lt;br /&gt;Long gone are the days when I last saw the (in)famous error message.  Most of us would have forgotten it by now.  One of the blogs that I was reading today mentioned about it.  And in a rhetoric manner.&lt;br /&gt;&lt;br /&gt;Why would you want to tell someone that something they entered is &lt;span style="font-style: italic;"&gt;bad&lt;/span&gt;?  Or something &lt;span style="font-style: italic;"&gt;bad&lt;/span&gt; has happened?  Isn't that really foolish?  Didn't Mom tell them: "If you can't say anything nice, don't say anything at all."  At least, don't say a &lt;span style="font-style: italic;"&gt;bad&lt;/span&gt; word.&lt;br /&gt;&lt;br /&gt;A major reason why software is not easy to learn is that it doesn't give positive feedback.  We learn better from positive feedback, rather than from negative feedback.  Would you prefer a hired ski instructor who yells at you?  Or a restaurant host who loudly announces to other patrons that your credit card was rejected?  Certainly not.  Then why the should software tell me that I failed?&lt;br /&gt;&lt;br /&gt;In my opinion, to be given negative feedback by software - any software - is an insult to human.  Yes, I've read the three laws of robotics, and can recite them for you even during sleep.&lt;br /&gt;&lt;br /&gt;Forget robotics and the mean machines, but for me, to be told by software that you have failed is degrading.  And the same should be for everyone.  There is nothing so important inside that dumb box that you can justify degrading a human user.  If you want to protect you files, do it.  But do so without bothering me.  It's all right to protect the computer but not at the cost of bothering the user.&lt;br /&gt;&lt;br /&gt;If I mistype a command, with bash, csh, sh, tcsh, zsh - they all tell me:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;command not found&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Well, that's better - it tells me without insulting me that my input could not be processed.  And it even hints that what I entered was treated as a command, without misleading me to file names.&lt;br /&gt;&lt;br /&gt;An error message is the program reporting on &lt;span style="font-style: italic;"&gt;its&lt;/span&gt; failure to do the job, and it is interrupting the user to do this.  So it must be polite, illuminating, and helpful.&lt;br /&gt;&lt;br /&gt;Have you never heard - &lt;span style="font-weight: bold;"&gt;The customer is always right&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-3669367563932741912?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/3669367563932741912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=3669367563932741912' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/3669367563932741912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/3669367563932741912'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/12/bad-command-or-file-name.html' title='bad command or file name'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-5668027824862290803</id><published>2008-11-17T23:14:00.020+05:30</published><updated>2008-12-09T17:27:06.300+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>How to count occurences of a tag in an xml file</title><content type='html'>How can you find out total occurrences of a particular tag in an XML file?  Say, I want to find out how many &lt;span style="font-style:italic;"&gt;property&lt;/span&gt; tags are present in an XML file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;grep&lt;/span&gt; is not sufficient for this task.  Here is a perl script that does the job.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;#!/usr/bin/perl&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;# count_xml_tags.pl&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;my $xml_tag  = shift;&lt;br /&gt;my $filename = shift;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;my $count &amp;nbsp; &amp;nbsp; = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;open (X_FILE, '&lt;', $filename)  or  die "Failed to read file $filename : $!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; &amp;nbsp; &amp;nbsp; local $/;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; &amp;nbsp; &amp;nbsp; while (&amp;lt;X_FILE&amp;gt;) {&lt;/span&gt;&lt;br /&gt;   &lt;x_file style="font-weight: bold;"&gt;&lt;span style="font-family:courier new;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (m#&lt;/span&gt;&lt;song_id style="font-family: courier new;"&gt;&lt;/song_id&gt;&lt;/x_file&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&amp;lt;&lt;/span&gt;&lt;x_file style="font-weight: bold;"&gt;&lt;song_id style="font-family: courier new;"&gt;$xml_tag&amp;gt;(.*?)&amp;lt;/$xml_tag&amp;gt;&lt;/song_id&gt;&lt;span style="font-family:courier new;"&gt;#gs) {&lt;/span&gt;&lt;br /&gt;&lt;/x_file&gt;      &lt;x_file style="font-weight: bold;"&gt;&lt;span style="font-family:courier new;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $count++;&lt;/span&gt;&lt;br /&gt;&lt;/x_file&gt;    &lt;x_file style="font-weight: bold;"&gt;&lt;span style="font-family:courier new;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;/x_file&gt;  &lt;x_file&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;close (X_FILE);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;print "$count $xml_tag tag(s) found.\n";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Run this script as:&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;% perl count_xml_tags.pl some_tag filename.xml&lt;/span&gt;&lt;/x_file&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-5668027824862290803?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/5668027824862290803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=5668027824862290803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/5668027824862290803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/5668027824862290803'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/11/how-to-count-occurences-of-tag-in-xml.html' title='How to count occurences of a tag in an xml file'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-3054623574292605972</id><published>2008-11-17T22:27:00.007+05:30</published><updated>2008-12-26T23:46:46.310+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='awk'/><category scheme='http://www.blogger.com/atom/ns#' term='uniq'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='sort'/><title type='text'>How to remove duplicate lines from a file</title><content type='html'>Our on-line publishing system has a text file that contains certain entries, one per line.  Some entries were duplicate, and we wanted to remove them.&lt;br /&gt;&lt;br /&gt;This can be done using &lt;span style="font-weight: bold;font-family:courier new;" &gt;sort&lt;/span&gt; and &lt;span style="font-weight: bold;font-family:courier new;" &gt;uniq&lt;/span&gt; commands.&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;sort /foo/bar | uniq &gt; /new/bar&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But we wanted to retain the order of lines, and so didn't want to sort the file.  I found a solution using &lt;span style="font-weight: bold;font-family:courier new;" &gt;awk&lt;/span&gt;.&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;awk '!x[$0]++' /foo/bar &gt; /new/bar&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;And how do I check if the file contains duplicate lines or not? The &lt;span style="font-weight: bold;font-family:courier new;" &gt;-d&lt;/span&gt; option of &lt;span style="font-weight: bold;font-family:courier new;" &gt;uniq&lt;/span&gt; command is helpful in this case. &lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;br /&gt;sort /foo/bar | uniq -d&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-3054623574292605972?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/3054623574292605972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=3054623574292605972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/3054623574292605972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/3054623574292605972'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/11/how-to-remove-duplicate-lines-from-file.html' title='How to remove duplicate lines from a file'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-6286444534633001608</id><published>2008-08-02T14:22:00.005+05:30</published><updated>2008-11-17T22:32:19.272+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>How to convert Unix time to human readable format</title><content type='html'>Unix-like operating systems maintain time as the number of seconds elapsed since midnight UTC of January 1, 1970.  For example, &lt;span style="font-family:courier new;"&gt;1217646573&lt;/span&gt; represents &lt;span style="font-family:courier new;"&gt;Sat Aug  2 08:39:33 2008&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;How do you convert time mentioned in the Unix time format to human readable format?  Perl is handy in this situation.&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;% perl -e 'print scalar localtime(1217646573), "\n";'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I used to work with a network monitoring software that produced logs containing time stamps in Unix time.  Analyzing the logs would be difficult unless the time stamps were replaced by a human readable format.&lt;br /&gt;&lt;br /&gt;The logs were as shown below.&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;STATUS [1217650382] Event: Description&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here's a perl one-liner that does the job.&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;% perl -pi -e 's#(?&lt;=\[)(\d+)(?=])#scalar localtime($2)#e' /foo/bar&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-6286444534633001608?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/6286444534633001608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=6286444534633001608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/6286444534633001608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/6286444534633001608'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/08/how-to-convert-unix-time-to-human.html' title='How to convert Unix time to human readable format'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-3676791197132406151</id><published>2008-08-01T14:12:00.000+05:30</published><updated>2008-08-01T14:13:32.915+05:30</updated><title type='text'>My Geek Code</title><content type='html'>&lt;span style="font-family: courier new;"&gt;-----BEGIN GEEK CODE BLOCK-----&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Version 1.0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;GO d-@ s: a- C++$ UBL++&gt;$ P+++&gt;$ L+++&gt;$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;E- W++ N+ o K w-- !O- !M- V-&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;@PS+ @PE++ Y+ !PGP&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;t 5 X R+++ tv b+&gt; DI++ D G&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;e++ h--- r+++ y+++&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;------END GEEK CODE BLOCK------&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-3676791197132406151?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/3676791197132406151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=3676791197132406151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/3676791197132406151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/3676791197132406151'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/08/my-geek-code.html' title='My Geek Code'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-5211355898599103995</id><published>2008-07-31T15:08:00.016+05:30</published><updated>2008-08-01T10:29:49.978+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>How to find out if a given year is a leap year or not?</title><content type='html'>Well, for that, how do you define a leap year?&lt;br /&gt;Leap year is every year the number of which is a multiple of four, except those devisible by 100 and not by 400.&lt;br /&gt;&lt;br /&gt;Here are the steps to determine if a given year is a leap year or not:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if year modulo 400 is 0 then leap&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; &amp;nbsp; &amp;nbsp; else if year modulo 100 is 0 then no_leap&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; &amp;nbsp; &amp;nbsp; else if year modulo 4 is 0 then leap&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; &amp;nbsp; &amp;nbsp; else no_leap&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is one Perl implementation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#!/usr/bin/perl&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;use strict;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;use warnings;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;######  is_leap_year  ######&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# Purpose    : To determine whether a given year is a leap year or not&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# Arguements : One&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#    First (Number): Year to be checked&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# Returns    : Boolean value indicating whether given year is a leap year or not&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#    true  = given year is a leap year&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#    false = given year is not a leap year&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;############################&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sub is_leap_year ($)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;my $year = shift;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return  unless ($year =~ m/^\d+$/);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (($year % 400) == 0) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# This year is completely divisible by 400&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 1; &amp;nbsp; &amp;nbsp; # This is a leap year&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;elsif (($year % 100) == 0) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# This year is completely divisible by 100&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 0; &amp;nbsp; &amp;nbsp; # This is not a leap year&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;elsif (($year % 4) == 0) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# This year is completely divisible by 4&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 1; &amp;nbsp; &amp;nbsp; # This is a leap year&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 0; &amp;nbsp; &amp;nbsp; # This is not a leap year&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;my $this_year = 2040;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if (is_leap_year ($this_year)) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print $this_year, " is a leap year\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;else {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print $this_year, " is a not a leap year\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-5211355898599103995?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/5211355898599103995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=5211355898599103995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/5211355898599103995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/5211355898599103995'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/07/how-to-find-out-if-given-year-is-leap.html' title='How to find out if a given year is a leap year or not?'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-1813114518396601225</id><published>2008-07-30T16:57:00.016+05:30</published><updated>2008-11-17T23:08:31.791+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='grep'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Count number of occurrences of a word</title><content type='html'>How can you count number of occurrences of a word in a file?  Say, I want to count how many times &lt;span style="font-family:courier new;"&gt;ring&lt;/span&gt; is present in a file.&lt;br /&gt;&lt;br /&gt;How about using the &lt;span style="font-family:courier new;"&gt;-c&lt;/span&gt; option of &lt;span style="font-family:courier new;"&gt;grep&lt;/span&gt;?&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;% grep -c ring /foo/bar&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And what if the file contains words such as &lt;span style="font-family:courier new;"&gt;string&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;rings&lt;/span&gt;?  That would break our count of &lt;span style="font-family:courier new;"&gt;ring&lt;/span&gt;.&lt;br /&gt;Using the &lt;span style="font-family:courier new;"&gt;-w&lt;/span&gt; option of &lt;span style="font-family:courier new;"&gt;grep&lt;/span&gt; solves this problem&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;% grep -cw ring /foo/bar&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What if the word &lt;span style="font-family:courier new;"&gt;ring&lt;/span&gt; is present more than once in a line?  &lt;span style="font-family:courier new;"&gt;grep&lt;/span&gt; would produce incorrect count in this case, since it counts the &lt;span style="font-style: italic;"&gt;number of lines&lt;/span&gt; in which the pattern is found.  &lt;span style="font-family:courier new;"&gt;grep&lt;/span&gt; is not sufficient for this job.  We need something that can count multiple occurrences of a word in a line.&lt;br /&gt;&lt;br /&gt;To get the exact count:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#!/usr/bin/perl&lt;br /&gt;# search_word.pl&lt;br /&gt;my $search_this = shift   or   exit 1;&lt;br /&gt;my $count          = 0;&lt;br /&gt;while (&lt;&gt;) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; while (m/\b$search_this\b/g) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $count++;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;if ($count == 0) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; print $ARGV . "does not contain " . $search_this . "\n";&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;&amp;nbsp; &amp;nbsp; print $ARGV . "contains " . $search_this . " " . $count . (($count == 1) ? " time\n" : " times\n");&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Run this &lt;span style="font-family:courier new;"&gt;perl&lt;/span&gt; script as:&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;% perl search_word.pl ring filename&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And what if I don't want to use Perl?   Well, then this should work for you:&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;% grep -w -o ring /foo/bar | wc -l&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-1813114518396601225?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/1813114518396601225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=1813114518396601225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/1813114518396601225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/1813114518396601225'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/07/count-number-of-occurrences-of-word.html' title='Count number of occurrences of a word'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-1233697079589279864</id><published>2008-07-29T17:15:00.005+05:30</published><updated>2008-07-30T10:17:22.225+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='awk'/><category scheme='http://www.blogger.com/atom/ns#' term='sed'/><title type='text'>Why not to use awk when sed can do the job?</title><content type='html'>&lt;ul&gt;&lt;li&gt;Using &lt;span style="font-family:courier new;"&gt;awk&lt;/span&gt; instead of &lt;span style="font-family:courier new;"&gt;sed&lt;/span&gt; has the price of performance and size&lt;/li&gt;&lt;li&gt;compared to &lt;span style="font-family:courier new;"&gt;sed&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;ed&lt;/span&gt;, &lt;span style="font-family:courier new;"&gt;awk&lt;/span&gt; takes a substantially longer time to load, and does its job at a considerably slower pace&lt;/li&gt;&lt;li&gt;The real distinguishing point between &lt;span style="font-family:courier new;"&gt;sed&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;awk&lt;/span&gt; as a text processor is that &lt;span style="font-family:courier new;"&gt;awk&lt;/span&gt; is able to work with a persistent context, whereas capabilities of &lt;span style="font-family:courier new;"&gt;sed&lt;/span&gt; in this area are limited to non-existent. If you - for instance - would have to sum one field to a total you would do it with &lt;span style="font-family:courier new;"&gt;awk&lt;/span&gt; (it would be possible to do it with &lt;span style="font-family:courier new;"&gt;sed&lt;/span&gt;, but would be a nightmare - poorly suited tool for the job)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-1233697079589279864?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/1233697079589279864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=1233697079589279864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/1233697079589279864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/1233697079589279864'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/07/why-not-to-use-awk-when-sed-can-do-job.html' title='Why &lt;span style=&quot;font-style:italic;&quot;&gt;not&lt;/span&gt; to use &lt;span style=&quot;font-family:courier new;&quot;&gt;awk&lt;/span&gt; when sed can do the job?'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-7378408947863399721</id><published>2008-07-28T15:08:00.007+05:30</published><updated>2008-11-17T22:35:32.916+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Changing size of a file</title><content type='html'>How do you change the size of a file in Linux?  If you are not concerned about the contents of the file, use the &lt;span style="font-family:courier new;"&gt;dd&lt;/span&gt; command.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;dd  if=/dev/zero  of=/foo/bar  bs=1024  count=1&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;This would change the size of a file to 1 KB.  inode number of the file would be preserved.&lt;br /&gt;&lt;br /&gt;So if you want to change the size to 2 MB&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;dd  if=/dev/zero  of=/foo/bar  bs=1024  count=2048&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Note that 2 MB is 2048 KB, and not 2000 KB.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-7378408947863399721?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/7378408947863399721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=7378408947863399721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/7378408947863399721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/7378408947863399721'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/07/changing-size-of-file.html' title='Changing size of a file'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-6427358198019685222</id><published>2008-07-27T17:06:00.002+05:30</published><updated>2008-07-27T17:10:30.921+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Epigram'/><title type='text'>Epigram on a Software Laird</title><content type='html'>&lt;span style="font-family:verdana;"&gt;Bless Linus Torvalds, O Engineer,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;With grateful, lifted eyes,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Who taught that not the windows alone,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;But doors too shall open;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;For had He said "the doors alone&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;From source I will deliver,"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Alas, alas! O Engineer,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Then hadst thou lain for ever.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Original work:  &lt;a href="http://en.wikisource.org/wiki/Epigram_on_a_Country_Laird"&gt;Epigram on a Country Laird by Robert Burns&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-6427358198019685222?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/6427358198019685222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=6427358198019685222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/6427358198019685222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/6427358198019685222'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/07/epigram-on-software-laird.html' title='Epigram on a Software Laird'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-5567042432125682316</id><published>2008-07-22T15:21:00.002+05:30</published><updated>2008-07-23T17:08:04.422+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='sort'/><title type='text'>Sorting alphanumeric strings in Perl</title><content type='html'>&lt;span style="font-family:arial;"&gt;One of my friends had trouble sorting alphanumeric strings in Perl.  Strings he had were similar to:&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-family:courier new;"&gt;  child1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  child3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  child11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  child51&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  child5&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  child24&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;He wanted to sort them based on the numbers that follow after the alphabtic part.  So, the order he wanted:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;child1&lt;br /&gt;child3&lt;br /&gt;child5&lt;br /&gt;child11&lt;br /&gt;child24&lt;br /&gt;child51&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;I extracted the numeric part from the alphanumeric string and used it for comparisons&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-family:verdana;"&gt;@alphanumeric_sorted = sort { substr($a, 5) &lt;=&gt; substr($b, 5)} @alphanumeric;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-5567042432125682316?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/5567042432125682316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=5567042432125682316' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/5567042432125682316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/5567042432125682316'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/07/sorting-alphanumeric-strings-in-perl.html' title='Sorting alphanumeric strings in Perl'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5861681549126071928.post-7349549865957890508</id><published>2008-07-21T14:12:00.002+05:30</published><updated>2008-07-27T17:16:12.349+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>Apache Lyrics</title><content type='html'>&lt;span style=";font-family:sans-serif;font-size:85%;"  &gt;&lt;span style="font-family:arial;"&gt;Sometime last year I wrote parody of a famous  song.  Some of the lines of this song are in  Spanish, and you need to know a bit of Spanish to understand them.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style=";font-family:Verdana;font-size:130%;"  &gt;&lt;b&gt;"Ports Won't Die"&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana;font-size:78%;"  &gt;&lt;b&gt;  (feat. Office Assistant)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Macros up in here tonight&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  No fighting, no fighting&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  We got the fixes up in here&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  No fighting, no fighting&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Apache, Apache&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  I never really knew that it could serve so fast&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  It makes a man wants to HTTP&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Como se llama (si), bonita (si), mi OS (si, Apache Apache), su OS&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Apache, Apache&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Oh baby when you talk like that&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  You make IIS go mad&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  So be wise and keep on&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Reading the signs of my Ballmer&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And I'm on tonight&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  You know my ports won't die&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And I'm starting to feel it's right&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  All the attraction, the tension&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Don't you see baby, this is perfection&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Hey Girl, I can see your traffic moving&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And it's driving me crazy&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And I didn't have the slightest idea&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Until I saw you serving&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And when you take up a bad request&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Nobody cannot ignore the way you check it out, girl&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And architecture so perfected - the way you right and left it&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  So you can keep on excelling&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  I never really knew that it could serve so fast&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  It makes a man want to HTTP&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Como se llama (si), bonita (si), mi OS (si, Apache Apache), su OS&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Apache, Apache&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Oh baby when you talk like that&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  You make IIS go mad&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  So be wise and keep on&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Reading the signs of my Ballmer&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And I'm on tonight&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  You know my ports won't die&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And I am starting to feel you boy&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Come on lets go, real slow&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Don't you see baby asi es perfecto&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Oh I know I am on tonight my ports won't die&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And I am starting to feel it's right&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  All the attraction, the tension&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Don't you see baby, this is perfection&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Apache, Apache&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Oh boy, I can see your traffic moving&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Half filtered, half cached&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  I don't, don't really know what I'm doing&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  But you seem to have a plan&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  My will and self restraint&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Have come to fail now, fail now&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  See, I am doing what I can, but I can't so you know&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  That's a bit too hard to explain&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Roca en el Internet toda la noche&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Roca en el Internet toda el día&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Roca en el Internet toda la noche&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Roca en el Internet toda el día&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  I never really knew that it could serve so fast&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  It makes a man want to HTTP&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Como se llama (si), bonita (si), mi OS (si, Apache Apache), su OS&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Apache, Apache&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Oh baby when you talk like that&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  You know you got me hypnotized&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  So be wise and keep on&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Reading the signs of my Ballmer&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Senorita, feel the conga, let me see you serve like you come from Redmond&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Mira en Maryland se baila así, say it!&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Mira en Maryland se baila así&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Yeah&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  It's so popular, macro shaft's jealousy a refugee like me back with the  Fugees from a buggy territory&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  I go back like when 'pac carried crates for Humpty Humpty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  I need a whole club dizzy&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Why the Court wanna break us?&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Explorers and Windows&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  I ain't guilty, it's no monopoly transaction&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  No more do we snatch ropes&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Refugees run the seas 'cause we own our own browser&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  I'm on tonight, my ports won't die&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And I'm starting to feel you boy&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Come on let's go, real slow&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Baby, like this is perfecto&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Oh, you know I am on tonight and my ports won't die&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  And I am starting to feel it's right&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  The attraction, the tension&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  Baby, like this is perfection&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  No fighting&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:100%;"  &gt;  No fighting&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5861681549126071928-7349549865957890508?l=ysawant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ysawant.blogspot.com/feeds/7349549865957890508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5861681549126071928&amp;postID=7349549865957890508' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/7349549865957890508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5861681549126071928/posts/default/7349549865957890508'/><link rel='alternate' type='text/html' href='http://ysawant.blogspot.com/2008/07/sometime-last-year-i-wrote-parody-of.html' title='Apache Lyrics'/><author><name>Yogesh Sawant</name><uri>http://www.blogger.com/profile/13020560079992265041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp3.blogger.com/_RmX7jFo70yc/SIRLXGM9aXI/AAAAAAAAAnU/DeYwDleW17g/S220/Me.jpeg'/></author><thr:total>0</thr:total></entry></feed>
