<?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-8129160</id><updated>2012-01-21T19:06:45.459+08:00</updated><category term='ruby'/><category term='Python'/><category term='Unix'/><category term='phpMyAdmin'/><category term='MySQL'/><category term='TSV'/><category term='WAMPServer'/><category term='C'/><category term='sqlite'/><category term='SED'/><category term='rvm'/><category term='CSV'/><category term='Windows'/><category term='Sort'/><category term='Multi-level Sort'/><category term='Skype'/><category term='OS X'/><category term='PHP'/><category term='Scripting'/><category term='rspec'/><category term='print'/><category term='Fork'/><category term='Numeric Sort'/><category term='ruby on rails'/><category term='git'/><category term='Linux'/><category term='rails'/><category term='Mac'/><category term='Apache'/><category term='Bash'/><category term='bundle'/><title type='text'>Technoblog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8129160.post-600840711684143527</id><published>2011-12-25T00:45:00.006+08:00</published><updated>2011-12-25T02:08:37.584+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OS X'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><category scheme='http://www.blogger.com/atom/ns#' term='rvm'/><category scheme='http://www.blogger.com/atom/ns#' term='Bash'/><title type='text'>Installing rvm in mac os x lion using bash</title><summary type='text'>They are giving MacBook Pro as our laptop in our office. I wanted to install ruby. For this purpose, I wanted to install rvm. Based on instructions I found in the rvm site, I gave the command to download the installer and do the installation:$ bash &lt; &lt;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)-sh: syntax error near unexpected token `&lt;'Since this can be split</summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/600840711684143527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=600840711684143527&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/600840711684143527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/600840711684143527'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2011/12/installing-rvm-in-mac-os-x-lion-using.html' title='Installing rvm in mac os x lion using bash'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-6221541263524392932</id><published>2011-10-22T00:47:00.001+08:00</published><updated>2011-10-22T00:49:26.183+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSV'/><category scheme='http://www.blogger.com/atom/ns#' term='TSV'/><category scheme='http://www.blogger.com/atom/ns#' term='print'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Special options while printing in Python 3.x</title><summary type='text'>
One more post about printing values in Python 3.x and how it differs with Python 2.x.

To print the end of line using Python 2.x, all you need to do is add a comma to the end of the print list.

print "Hello ",
print "World" 

The statements above print "Hello World" on the screen.

But with Python 3.x, it is different


print ("Hello ", end='')

print ("World")

This prints "Hello World" on the</summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/6221541263524392932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=6221541263524392932&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/6221541263524392932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/6221541263524392932'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2011/10/special-options-while-printing-in.html' title='Special options while printing in Python 3.x'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-2010139274129152737</id><published>2011-10-18T14:37:00.004+08:00</published><updated>2011-10-18T15:05:53.794+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='print'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Differences in print between Python 2.x and Python 3.x</title><summary type='text'>Recently, I started learning Python and installed the latest version available online - Python 3.2. I did this in spite of the fact that the book I was using "Practical Programming: An Introduction to Computer Science using Python".After completing a few exercises using the Python command line, I decided to save my script and execute them from command line. That is when things started to fail. </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/2010139274129152737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=2010139274129152737&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/2010139274129152737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/2010139274129152737'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2011/10/differences-in-print-between-python-2x.html' title='Differences in print between Python 2.x and Python 3.x'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-3503888331737683890</id><published>2010-12-08T16:20:00.003+08:00</published><updated>2010-12-08T16:53:30.900+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rspec'/><category scheme='http://www.blogger.com/atom/ns#' term='git'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='bundle'/><title type='text'>Moving from rspec 2.0.0.beta.18 to rspec 2.0.0.beta.22</title><summary type='text'>This post is primarily for anyone who is using rspec 2.0.0.beta.18 as specified in the Ruby on Rails Tutorial and find that they hit upon the following problem:Failure/Error: Unable to find C to read failed line  undefined method `get' for # do    include RSpec::Rails::RequestExampleGroup Whenever they run the tests:$ rspec spec/requests/layout_links_spec.rbTo fix this, I installed rspec 2.0.0.</summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/3503888331737683890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=3503888331737683890&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/3503888331737683890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/3503888331737683890'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2010/12/moving-from-rspec-200beta18-to-rspec.html' title='Moving from rspec 2.0.0.beta.18 to rspec 2.0.0.beta.22'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-5045474995260791920</id><published>2010-07-15T18:34:00.009+08:00</published><updated>2010-07-15T19:13:20.794+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='WAMPServer'/><category scheme='http://www.blogger.com/atom/ns#' term='phpMyAdmin'/><category scheme='http://www.blogger.com/atom/ns#' term='Skype'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>WAMPServer and Apache on Windows: Changing the port number</title><summary type='text'>It all started when I wanted to create an application with MySQL as a backend. Since I am not well versed in MySQL, one of my colleagues suggested that I use phpmyadmin. He had a nice installation of phpmyadmin installed in the tools development server we have in our office and I tried it for sometime. Today morning, I decided to install phpmyadmin in my local machine so that I can work on my </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/5045474995260791920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=5045474995260791920&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/5045474995260791920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/5045474995260791920'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2010/07/it-all-started-when-i-wanted-to-create.html' title='WAMPServer and Apache on Windows: Changing the port number'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ig2a6FGvaq0/TD7ppi_4cqI/AAAAAAAABlc/X_HV5rk-BwQ/s72-c/temp1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-3528214158658493</id><published>2010-06-12T22:33:00.002+08:00</published><updated>2010-06-12T22:37:14.858+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='sqlite'/><title type='text'>RoR page does not load on the browser</title><summary type='text'>Hi,As usual, I tried to learn something of something new - Ruby  on Rails. When I tried to create a brand new application as suggested in  "Beginning Ruby on Rails", I  hit upon a road block. The application would not load. And the log file  said:.  Could not open library 'libsqlite3': The specified module  could not be found.. Could not open library 'libsqlite3.dll':  The specified module could </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/3528214158658493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=3528214158658493&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/3528214158658493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/3528214158658493'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2010/06/ror-page-does-not-load-on-browser.html' title='RoR page does not load on the browser'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-8691097668220138771</id><published>2008-03-01T01:03:00.005+08:00</published><updated>2010-06-12T22:35:58.124+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='Multi-level Sort'/><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'/><category scheme='http://www.blogger.com/atom/ns#' term='Numeric Sort'/><category scheme='http://www.blogger.com/atom/ns#' term='Bash'/><title type='text'>Tips for unix sort command</title><summary type='text'>You might have used the sort command many times in the past for simple sort requirements.But did you know that one of the most frustrating and tough to find out problems in sort command is that the option -n has been missed. This option is used to specify that the sorting has to be done numerically - in other words, the field that is being used for sorting will be considered to be a numeric </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/8691097668220138771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=8691097668220138771&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/8691097668220138771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/8691097668220138771'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2008/03/tips-for-unix-sort-command.html' title='Tips for unix sort command'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-113142573834211523</id><published>2005-11-08T12:45:00.001+08:00</published><updated>2010-06-12T22:35:24.901+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><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='Fork'/><category scheme='http://www.blogger.com/atom/ns#' term='Bash'/><title type='text'>Bash - Choking the system - Fork bomb</title><summary type='text'>This is a wicked post. If you execute the script given in this, then you would need to restart the machine. The command::(){ :|:&amp; };:What does this mean::(){  : | : &amp;}:It creates a function called : and then calls the same recursively in the background. This would cause the system to choke due to continues creation of processes. This is called as a fork-bomb. Fork-bombs can be created in many </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/113142573834211523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=113142573834211523&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/113142573834211523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/113142573834211523'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2005/11/bash-choking-system-fork-bomb.html' title='Bash - Choking the system - Fork bomb'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-112855356667851289</id><published>2005-10-06T06:44:00.000+08:00</published><updated>2008-05-25T15:46:32.716+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>C - C calling convention</title><summary type='text'>When we call a function in C, some details are sent into the stack. These include the details like the address of the location in the calling function where the control must return after a call to the function and also the details pertaining to the arguments.But there is one question remaining: What is the order in which the arguments are passed? Meaning: Are they passed from the leftmost to </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/112855356667851289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=112855356667851289&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/112855356667851289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/112855356667851289'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2005/10/c-c-calling-convention.html' title='C - C calling convention'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-112419267429374650</id><published>2005-08-16T18:37:00.000+08:00</published><updated>2010-06-12T22:36:07.894+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><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='Bash'/><title type='text'>Bash - Careful while using $?</title><summary type='text'>The exit status of a command can be obtained using the shell variable $?. In other words, $? contains the exit status of the preceding command. But there are some cases when using this carelessly can cause errors.One such scenario in which using this can be a problem is when there are multiple exit values possible.For example:#!/bin/bash/bin/ls * &gt; /home/karthick/lsfile 2&gt;&amp;1if [ $? -eq 0 ]</summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/112419267429374650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=112419267429374650&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/112419267429374650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/112419267429374650'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2005/08/bash-careful-while-using.html' title='Bash - Careful while using $?'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-111761924501037884</id><published>2005-06-01T16:23:00.000+08:00</published><updated>2010-06-12T22:36:07.895+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><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='Bash'/><title type='text'>Bash - Using Input Field Separators</title><summary type='text'>Consider the following snippet:#!/bin/bashfor i in `/bin/cat /etc/passwd`doif echo $i grep $1 # To see how this works, check herethenecho "Found $1"exit 0fidoneecho "Not found $1"exit 1This might not work in all cases. Consider this user:ftp:*:14:50:Only ftp user:/var/ftp:/sbin/nologinWhen we search for the user ftp, the output is:$ sh cond.sh ftpftp:*:14:50:OnlyFound ftpThis is not the expected </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/111761924501037884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=111761924501037884&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/111761924501037884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/111761924501037884'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2005/05/bash-using-input-field-separators.html' title='Bash - Using Input Field Separators'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-111310626430479139</id><published>2005-04-10T12:02:00.000+08:00</published><updated>2008-05-25T15:45:57.882+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bash'/><title type='text'>Bash - Reading line-by-line in a loop</title><summary type='text'>This is something that many people would know.Let us take an example:$ cat ~/fileIf you take every crisis as an opportunityLife will not only be successful,But will also be satisfying.Let us assume that you want to display all lines which have "will" in them.One way to do this would be by reading the file line by line and looking for "will". To do this use the following loop:#!/bin/bashwhile read</summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/111310626430479139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=111310626430479139&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/111310626430479139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/111310626430479139'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2005/04/bash-reading-line-by-line-in-loop.html' title='Bash - Reading line-by-line in a loop'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-111220615980624755</id><published>2005-03-31T01:37:00.000+08:00</published><updated>2010-06-12T22:36:07.896+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><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='Bash'/><title type='text'>Bash - Using statements in conditions</title><summary type='text'>To test the success or failure of a command, the general method of scripting is as follows:#!/bin/bashcommandif [ $? -eq 0 ]then    # Command executed successfullyelse    # Command execution failedfiA better method to do the same is as follows:#!/bin/bashif commandthen    # Command executed successfullyelse    # Command executed failedfiPlease note the change in syntax for if between the two </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/111220615980624755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=111220615980624755&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/111220615980624755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/111220615980624755'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2005/03/bash-using-statements-in-conditions.html' title='Bash - Using statements in conditions'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-111104370300481291</id><published>2005-03-17T14:52:00.000+08:00</published><updated>2010-06-12T22:36:07.896+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><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='Bash'/><title type='text'>Bash - Stdout and Stderr redirection to a file (Part two)</title><summary type='text'>What happens when we use &gt;&gt; for redirection. This operator opens the files in append mode and hence there are no issues due to overwriting values.But try this:#!/bin/bashexec &gt;&gt;foo 2&gt;&gt;&amp;1echo hello &gt;&amp;1echo boss &gt;&amp;2Try making it this way:#!/bin/bash exec &gt;&gt;foo 2&gt;&gt;1 echo hello &gt;&amp;1 echo boss &gt;&amp;2Now you see that the file 1 is created with the text boss. So, the bottomline is &gt;&gt; cannot be used with &amp;.</summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/111104370300481291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=111104370300481291&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/111104370300481291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/111104370300481291'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2005/03/bash-stdout-and-stderr-redirection-to.html' title='Bash - Stdout and Stderr redirection to a file (Part two)'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-111104047964577025</id><published>2005-03-17T13:02:00.000+08:00</published><updated>2010-06-12T22:36:07.897+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><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='Bash'/><title type='text'>Bash - Stdout and Stderr redirection to a file</title><summary type='text'>There is a difference between giving:    command &gt;file1 2&gt;file1and    command &gt; file1 2&gt;&amp;1In the former case, the two redirections maintain two different file handles and hence the data might not be what we expect it to be.Try the following in a script:#!/bin/bashexec &gt;foo1 2&gt;foo1echo hello &gt;&amp;1echo boss &gt;&amp;2In the latter case however, the two redirections share the same handle. Hence this is </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/111104047964577025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=111104047964577025&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/111104047964577025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/111104047964577025'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2005/03/bash-stdout-and-stderr-redirection-to_16.html' title='Bash - Stdout and Stderr redirection to a file'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-110692084969048923</id><published>2005-01-28T20:21:00.000+08:00</published><updated>2010-06-12T22:36:07.898+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='SED'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>Basics of SED</title><summary type='text'>Some points about sed that we need to know on day 1 of learning sed:1) Sed is a stream editor and hence takes input from a file or group of files.2) By default, the output of sed is displayed in stdout. If we want the output to be stored in a file, then we can redirect it to some temporary file using "&gt;".3) Sed scripts can be written and sed commands can also be used in shell scripts.4) Since</summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/110692084969048923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=110692084969048923&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/110692084969048923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/110692084969048923'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2005/01/basics-of-sed.html' title='Basics of SED'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-110691488073022439</id><published>2005-01-28T20:07:00.000+08:00</published><updated>2010-06-12T22:36:07.899+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='SED'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>SED - Replace patterns in a file using sed</title><summary type='text'>One of the best tools for editing a stream of characters is sed. In fact sed stands for stream editor. One of my favorite commands in sed is the substitute command. The command syntax is as follows:$ sed 's/orig/new/' source &gt; destThe command uses regular expressions and hence "orig" is a regular expression. The command substitutes all occurences of the original pattern with "new".As can be seen </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/110691488073022439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=110691488073022439&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/110691488073022439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/110691488073022439'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2005/01/sed-replace-patterns-in-file-using-sed.html' title='SED - Replace patterns in a file using sed'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8129160.post-109447521985104883</id><published>2004-09-06T18:57:00.000+08:00</published><updated>2008-05-25T15:46:32.717+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>GCC - Creating shared objects and using them.</title><summary type='text'>The answer using gcc: Header files are generally used to hold the declaration of the function. The definition of the function is present in a separate file (the .c file) to link this declaration and definition we create shared objects (I think there is another method which does not use shared objects but I do not know how to do that.) For any file foo.c that has the declarations in foo.h:$ </summary><link rel='replies' type='application/atom+xml' href='http://karthicks.blogspot.com/feeds/109447521985104883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8129160&amp;postID=109447521985104883&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/109447521985104883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8129160/posts/default/109447521985104883'/><link rel='alternate' type='text/html' href='http://karthicks.blogspot.com/2004/09/gcc-creating-shared-objects-and-using.html' title='GCC - Creating shared objects and using them.'/><author><name>Karthick S</name><uri>https://profiles.google.com/117677917940559467971</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
