<?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-30111740</id><updated>2012-01-30T13:37:12.314-06:00</updated><category term='Python'/><category term='Videos'/><category term='Awk Scripting'/><category term='Unix Commands'/><category term='Unix Shell'/><category term='Unix Philosophy'/><category term='Shell Scripts'/><category term='Misc'/><category term='Trading scripts'/><category term='Perl'/><category term='Awk Syntax'/><category term='Oracle'/><category term='Java'/><category term='Java Script'/><title type='text'>Unix Simplicity</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default?start-index=101&amp;max-results=100'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>534</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-30111740.post-7016195830195020334</id><published>2012-01-23T00:39:00.000-06:00</published><updated>2012-01-23T00:39:33.153-06:00</updated><title type='text'>New Middle Eastern Search Engine Marketing Trend is Social Network Optimization</title><content type='html'>Social networks and "web 2.0" are now such an important part of the internet, that the most recent trend among &lt;a href="http://www.levantdigital.com/"&gt;Middle Eastern search engine marketing firm&lt;/a&gt;s is advising clients on how to design social media friendly sites.  &lt;br /&gt;&lt;br /&gt;This is a growing way of attracting traffic to Middle Eastern web sites, which is the ultimate goal of any &lt;a href="http://www.levantdigital.com/"&gt;middle eastern search engine optimization firm&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;While the search engine optimization part of their service is still concerned with getting the website ranked higher by the major search engines, the newly created social media optimization part is concerned with encouraging visitors to communicate about the site, and pass out links, to their social connections.&lt;br /&gt;&lt;br /&gt;This primarily involves 2 activities: encouraging the creation of content that excites your target audience, and providing widgets or links that allow them to easily share your content with one click (for example, a "like" icon to share on Facebook).&lt;br /&gt;&lt;br /&gt;This new social traffic can also be fed into &lt;a href="http://www.levantdigital.com/"&gt;middle eastern ppc management&lt;/a&gt; campaigns.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-7016195830195020334?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/7016195830195020334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=7016195830195020334' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7016195830195020334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7016195830195020334'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2012/01/new-middle-eastern-search-engine.html' title='New Middle Eastern Search Engine Marketing Trend is Social Network Optimization'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-555187185409500015</id><published>2012-01-23T00:21:00.000-06:00</published><updated>2012-01-23T00:21:30.751-06:00</updated><title type='text'>The Unix Change Directory Command</title><content type='html'>In unix, the cd command is used to change directories.  For example, cd /tmp will put you in the /tmp directory.&lt;br /&gt;&lt;br /&gt;Here are some tips/tricks for cd:&lt;br /&gt;&lt;br /&gt;cd by itself or cd ~ will always put you in your home directory.&lt;br /&gt;&lt;br /&gt;cd ~username will put you in username's home directory.&lt;br /&gt;&lt;br /&gt;cd dir (without a /) will put you in a subdirectory. for example, if you are in /usr, typing cd bin will put you in /usr/bin, while cd /bin puts you in /bin.&lt;br /&gt;&lt;br /&gt;cd ..  will move you up one directory. So, if you are /usr/bin/tmp, cd .. moves you to /usr/bin, while cd ../.. moves you to /usr (i.e. up two levels).  You can use this indirection to access subdirectories too.  So, from /usr/bin/tmp, you can use cd ../../local to go to /usr/local.&lt;br /&gt;&lt;br /&gt;cd - will switch you to the previous directory.  For example, if you are in /usr/bin/tmp, and go to /etc, you can type cd - to go back to /usr/bin/tmp.  You can use this to toggle back and forth between two directories.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-555187185409500015?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/555187185409500015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=555187185409500015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/555187185409500015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/555187185409500015'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2012/01/unix-change-directory-command.html' title='The Unix Change Directory Command'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2792888505046602700</id><published>2012-01-19T23:12:00.000-06:00</published><updated>2012-01-19T23:12:02.146-06:00</updated><title type='text'>WATCHING REALITY TV</title><content type='html'>Guest post written by my buddy Royce Heath&lt;br /&gt;&lt;br /&gt;I started watching another reality television show on &lt;a href="http://www.direct.tv/direct-tv/Delaware/"&gt;Direct.TV&lt;/a&gt;. It is one that I swore that I would never end up watching, but I actually really enjoy it. I know that everyone makes fun of it and thinks that it is totally ridiculous, especially after the big celebrity wedding that my favorite reality television show family had in August. Yes, I watched the wedding special. I even had some friends over to the house to watch the two day houbla. You can image our sheer and utter disappointment when we found out on Halloween that Kim Kardashian and Kris Humphries were ending their marriage after only seventy two days. I even felt a little betrayed, like the wedding may have been for show, but of course, I am watching the new season. I have to find out what happens to the marriage. So far, I can see exactly why the things ended up the way that they did. Kim and Kris barely spent anytime together after they got married. He was in Minnesota after they moved to New York and she traveled to Dubai without him. They also lived with Kim’s sister and her boyfriend.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2792888505046602700?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2792888505046602700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2792888505046602700' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2792888505046602700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2792888505046602700'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2012/01/watching-reality-tv.html' title='WATCHING REALITY TV'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8515847647381266475</id><published>2012-01-19T23:09:00.001-06:00</published><updated>2012-01-19T23:09:34.816-06:00</updated><title type='text'>Temperature Conversion Through Awk</title><content type='html'>&lt;div id=yiv1335709365&gt;&lt;div&gt;Here is an awk program to convert between celcius and Fahrenheit temperatures.&amp;nbsp; &lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;Unlike most of my programs, this program is interactive.&amp;nbsp; Once started, it interacts with the user at the command line, and accepts commands until the user quits.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;Here is the run:&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#007f40&gt;[&lt;/FONT&gt;&lt;font color=#007f40&gt;513]-&amp;gt;&lt;/FONT&gt; cel_fahr&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;Current input set to: fahrenheit&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;enter q, f, c, or temp:&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;212&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;212 degrees F is 100 degrees C&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;Current input set to: fahrenheit&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font  color=#007f40&gt;enter q, f, c, or temp:&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;rt&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;Current input set to: fahrenheit&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;enter q, f, c, or temp:&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;c&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;Current input set to: celcius&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;enter q, f, c, or temp:&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;0&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;0 degrees C is 32 degrees F&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#007f40&gt;Current input set to: celcius&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;enter q, f, c, or temp:&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;q&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;In the run above, the user input is in  black, while the displayed text is in green.&amp;nbsp; Notice that when I type in a number, the system interprets it as either degrees C or F (depending on the input setting), and prints the conversion.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;If I type "c" or "f", the input units are changed.&amp;nbsp; If I type "q", the system quits.&amp;nbsp; If I type anything else that is not a number (example "rt"), the program ignores it.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;Here is the script:&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#800000&gt;nawk '&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;BEGIN {&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;f = "fahrenheit"&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;c = "celcius"&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;choice = f&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;while (x != "q")&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;{&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;print&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;print "Current input set to: "choice&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;print "enter q, f, c, or temp: "&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;"read x;echo $x"|getline x&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;close "read x;echo $x"&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;if (x == "f") choice = f&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;if (x == "c") choice = c&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;if (x ~ /^[0-9]*$/ || -1*x ~ /^[0-9]*$/)&lt;/FONT&gt;&lt;/DIV&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#800000&gt;{&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;if (choice == f)&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;print x" degrees F is "5/9 * (x - 32)" degrees C"&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;if (choice == c)&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;print x" degrees C is "x*9/5 + 32"  degrees F"&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;}'&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;Let's analyze the script.&amp;nbsp; First, this script is completely in a BEGIN section, so it is a procedural program. We set the default choice to be fahrenheit, and then loop until&amp;nbsp;the user enters a "q".&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;In the loop, we start by printing the menu, and then use getline to create a shell process which reads from the keyboard into unix variable x and then echos unix variable x into getline, where it is assigned to x in the awk program.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;We then close the process so that, the next time we run the process, it will do a fresh read.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;If the input is either "f" or "c", we set the choice.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;Then, if the input is either a positive or negative  number, we convert it from the input units to the other unit, and display the result.&lt;/DIV&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;!-- toctype = X-unknown --&gt;&lt;!-- toctype = text --&gt;&lt;!-- text --&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8515847647381266475?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8515847647381266475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8515847647381266475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8515847647381266475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8515847647381266475'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2012/01/temperature-conversion-through-awk.html' title='Temperature Conversion Through Awk'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5366704029009238222</id><published>2011-12-31T18:31:00.000-06:00</published><updated>2011-12-31T18:31:31.886-06:00</updated><title type='text'>Why You Might Want To Leave Advanced SEO To The Experts</title><content type='html'>Most people who create web pages want the search engines to index their site, and send them lots of visitors.  To get more visitors, they want to engage in SEO (optimize their site for the search engines to rank it high).&lt;br /&gt;&lt;br /&gt;Anyone can create good content that will get indexed by the search engines, and rank higher for some key words and phrases - thus generating some traffic.  However, if you want to attract a large amount of traffic by ranking high for competitive key words (like "insurance"), you may want to hire an expert at &lt;a href="http://www.wpromote.com/seo"&gt;search engine optimization&lt;/a&gt; (seo).&lt;br /&gt;&lt;br /&gt;If you try to do your own optimization, you will have to spend hours away from your area of expertise (your business) and focus on concepts like choosing keywords, meta tags, keyword frequency, keyword density, etc.&lt;br /&gt;&lt;br /&gt;Also, someone trying to do SEO on their own will probably try to teach themselves site optimization through info products (books, ebooks, videos, mp3s, etc) that are probably out of date.  This is because search companies are frequently tuning their algorithms to refine their listings, and eliminate sites that are trying to game their rankings.&lt;br /&gt;&lt;br /&gt;SEO experts, on the other hand, are continually studying and learning.  Besides books and websites, they attend conferences, seminars, study white papers, and test / tweak / experiment on their own sites.  &lt;br /&gt;&lt;br /&gt;For them, SEO is their expertise, so they can afford to devote a lot of time to studying and learning the latest tends and techniques - while the owner of the website could be advancing in his or her own business.&lt;br /&gt;&lt;br /&gt;Another challenge for an individual doing his own SEO is the new opportunities and pitfalls involved in &lt;a href="http://www.trueseowebdesign.com/local-advertising-and-the-value-of-targeting-for-sem"&gt;local search engine optimization&lt;/a&gt;.  With the growth of mobile computing, local search engines and search results are increasing tremendously.  When potential customers filter a search for local results or use an engine that reads their GPS coordinates, a website that has optimized for location can jump ahead of someone who ranks higher for the keyword.&lt;br /&gt;&lt;br /&gt;Most website owners will not know all the nuances involved in optimizing for local searches.344  For all these reasons, website owners may want to outsource their search engine optimization to an expert.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5366704029009238222?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5366704029009238222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5366704029009238222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5366704029009238222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5366704029009238222'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/12/why-you-might-want-to-leave-advanced.html' title='Why You Might Want To Leave Advanced SEO To The Experts'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-1123042571283147416</id><published>2011-12-30T23:50:00.008-06:00</published><updated>2011-12-31T00:33:47.483-06:00</updated><title type='text'>A Random Coupon Generator Written in Awk</title><content type='html'>Here is an awk script I use to generate 100 random 8-character coupon codes.&lt;br /&gt;&lt;br /&gt;Each character has 62 possibilities (a-z, A-Z, and 0-9).  This means there are 8^62 possible coupon codes.&lt;br /&gt;&lt;br /&gt;BEGIN {&lt;br /&gt;&lt;br /&gt;s="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"&lt;br /&gt;&lt;br /&gt;srand()      &lt;br /&gt;&lt;br /&gt;for (i=1;i&lt;=100;i++){             code=""              for (j=1;j&lt;=8;j++)                 code = code""substr(s,int(rand()*62)+1,1)              print code          }        } Let's analyze the script.    First, we set string &lt;span style="font-style: italic;"&gt;s&lt;/span&gt; to hold all 62 possible characters.&lt;br /&gt;&lt;br /&gt;Next, we call &lt;span style="font-style: italic;"&gt;srand()&lt;/span&gt; to seed awk's random number generator.  We left the argument blank, so that the current date is used for seeding.&lt;br /&gt;&lt;br /&gt;We now loop 100 times, because we want to output 100 coupon codes.&lt;br /&gt;&lt;br /&gt;In this loop, we first set the coupon code back to the empty string.  Then, we have an inner loop that executes 8 times to build the code.  Finally, we print the code.&lt;br /&gt;&lt;br /&gt;Notice the command in the inner loop.  This command uses the random (rand) function.  Since rand() returns a number greater or equal to 0, and less than 1, we multiply it by 62 and use the integer (int) function.&lt;br /&gt;&lt;br /&gt;This will return a number between 0 and 61.  Why?  Because int(0*62) = int(0) = 0 and int(.999...*62) = int(61.99...) = 61.&lt;br /&gt;&lt;br /&gt;We then add 1 to the result to get a random number from 1-62.  We then use this result in the substr function to randomly pick a character.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-1123042571283147416?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/1123042571283147416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=1123042571283147416' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1123042571283147416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1123042571283147416'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/12/random-coupon-generator-written-in-awk.html' title='A Random Coupon Generator Written in Awk'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2775129067312965654</id><published>2011-12-17T01:19:00.004-06:00</published><updated>2011-12-17T01:26:48.207-06:00</updated><title type='text'>Creative Solutions For Trade Shows</title><content type='html'>Cleverness is not just reserved for computers.  Even in the real world, people use creative design to solve problems.&lt;br /&gt;&lt;br /&gt;For example, trade shows need booths and displays set up. It used to be, this took time.  A company had to reach the trade show location early the day before the show, so that the trade show workers could put their booths together.&lt;br /&gt;&lt;br /&gt;Now, however, there are modular components, such as &lt;a href="http://www.camelbackdisplays.com/Page_11x.htm "&gt;trade show flooring&lt;/a&gt; and &lt;a href="http://www.camelbackdisplays.com/Page_11x.htm"&gt;trade show carpet&lt;/a&gt; that can be set up rather quickly.&lt;br /&gt;&lt;br /&gt;Also, at trade shows, companies are no longer stuck with booths that look identical to every other one.  Props such as &lt;a href="http://www.camelbackdisplays.com/logo-mats.htm"&gt;logo mats&lt;/a&gt; and &lt;a href="http://www.camelbackdisplays.com/Graphic-Tents.htm"&gt;logo canopy&lt;/a&gt;s allow quick and inexpensive customization.&lt;br /&gt;&lt;br /&gt;Together, these products allow companies to set up fast, customized trade show booths - especially good for small exhibits outside of convention halls: for example, in stores, during festivals, at sports events, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2775129067312965654?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2775129067312965654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2775129067312965654' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2775129067312965654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2775129067312965654'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/12/creative-solutions-for-trade-shows.html' title='Creative Solutions For Trade Shows'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2693128763116505080</id><published>2011-12-14T13:06:00.000-06:00</published><updated>2011-12-17T01:06:49.529-06:00</updated><title type='text'>Using Read-Only Constants in Unix Shell Scripts</title><content type='html'>You can use typeset -r  to make variables in a ksh script be read-only.  This effectively makes them constants, which can no longer be modified.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;[550]-&gt; pi=3.14159&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;[551]-&gt; echo $pi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;3.14159&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;[552]-&gt; typeset -r pi&lt;br /&gt;&lt;br /&gt;[553]-&gt; pi=45&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;ksh: pi: is read only&lt;br /&gt;&lt;br /&gt;[554]-&gt; echo $pi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;3.14159&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2693128763116505080?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2693128763116505080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2693128763116505080' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2693128763116505080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2693128763116505080'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/12/using-read-only-constants-in-unix-shell.html' title='Using Read-Only Constants in Unix Shell Scripts'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-3121913604053431060</id><published>2011-12-05T10:59:00.034-06:00</published><updated>2011-12-17T01:05:18.228-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix Shell'/><title type='text'>Removing Carriage Return Line Feeds (CRLF's) From Text Files in Unix</title><content type='html'>In unix, each line in a text file ends with a line feed.  Windows text files, however, end each line with a carriage return and a line feed.&lt;br /&gt;&lt;br /&gt;Normally, when you ftp a text file between Windows and unix, the end of line characters get converted.  Sometimes, however, the carriage return and line feed get translated into Unix.  This can happen, for example, if the FTP is set to binary mode before the file is sent.&lt;br /&gt;&lt;br /&gt;When a unix file has both a carriage return and a line feed, it will display a control M at the end of each line. You can remove them in the vi editor:&lt;br /&gt;&lt;br /&gt;1. vi the file.&lt;br /&gt;2. Type colon to get a search line.&lt;br /&gt;3. Type 1,$s/ctrl v ctrl m/$&lt;br /&gt;&lt;br /&gt;Control v is needed to "escape" the entering of control-m.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-3121913604053431060?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/3121913604053431060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=3121913604053431060' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3121913604053431060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3121913604053431060'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/12/removing-carriage-return-line-feeds.html' title='Removing Carriage Return Line Feeds (CRLF&apos;s) From Text Files in Unix'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-1114283314574542673</id><published>2011-11-11T22:54:00.001-06:00</published><updated>2011-11-11T22:54:37.822-06:00</updated><title type='text'>Using Awk to Estimate Internal Rate of Return</title><content type='html'>On my &lt;a href="http://math-play.blogspot.com/"&gt;math and logic blog&lt;/a&gt;, I have a &lt;a href="http://math-play.blogspot.com/2010/07/quick-and-dirty-method-for-calculating.html"&gt;post explaining a quick and dirty method of calculating the approximate rate of return&lt;/a&gt; for a investment where additional funds were added during the year.&lt;br /&gt;&lt;br /&gt;In this post, I will present an Awk script for implementing this method.&lt;br /&gt;&lt;br /&gt;Basically, we want to read in a file with three fields: the starting value, ending value, and amount added during the time period.  Each line could be a different year, month, etc.&lt;br /&gt;&lt;br /&gt;For example, a line of:&lt;br /&gt;&lt;br /&gt;10000 15000 2000&lt;br /&gt;&lt;br /&gt;means that our investment started the time period with a value of $10,000, finished with a value of $15,000, and we added an additional $2,000 into the investment during the course of the time period.&lt;br /&gt;&lt;br /&gt;We can't simply say that we converted $12,000 into $15,000 because we did not have $12,000 invested throughout the time period.&lt;br /&gt;&lt;br /&gt;The quick and dirty method is to add 1/2 the additional amount to the starting balance and subtract 1/2 the additional amount from the ending balance.  This method works best when the additional money was contributed in regular deposits across the time period.&lt;br /&gt;&lt;br /&gt;So, for the example above, the return would be 14000/11000 = a return of 27.27%.&lt;br /&gt;&lt;br /&gt;Finally, the awk script outputs the total return from all entries of the file. So, if the file represented the year, and each line represented a month, the program will calculate 12 monthly returns and the yearly return.&lt;br /&gt;&lt;br /&gt;Here is the awk script:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;BEGIN {tret = 1}&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;{&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;start = $1&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;end = $2&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;start += $3/2&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;end -= $3/2&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;ret = end/start&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;tret *= ret&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;print $0" "ret&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;}&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;END {print "return = "tret }&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-1114283314574542673?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/1114283314574542673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=1114283314574542673' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1114283314574542673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1114283314574542673'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/11/using-awk-to-estimate-internal-rate-of.html' title='Using Awk to Estimate Internal Rate of Return'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5886554018833836276</id><published>2011-11-10T13:31:00.000-06:00</published><updated>2011-11-10T13:31:03.218-06:00</updated><title type='text'>"Stock Trading Riches" is now available in Kindle format on Amazon.com</title><content type='html'>My book "Stock Trading Riches" is now available in &lt;a href="http://www.amazon.com/Stock-Trading-Riches-ebook/dp/B0065CE3VO/ref=pd_rhf_dp_p_t_1"&gt;Kindle format&lt;/a&gt; on Amazon.com.&lt;br /&gt;&lt;br /&gt;Since this is a new format, it's priced for now at $2.99.&lt;br /&gt;&lt;br /&gt;They did a good job in the conversion - I saw that the stock tables and programming scripts display well, and the links are click-able.&lt;br /&gt;&lt;br /&gt;You don't need to own a Kindle to buy this edition. You can download free readers for PC's, Mac's, iPads, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5886554018833836276?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5886554018833836276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5886554018833836276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5886554018833836276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5886554018833836276'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/11/stock-trading-riches-is-now-available.html' title='&quot;Stock Trading Riches&quot; is now available in Kindle format on Amazon.com'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-142486057961543580</id><published>2011-11-06T00:03:00.000-05:00</published><updated>2011-11-06T00:03:53.920-05:00</updated><title type='text'>Reading for me</title><content type='html'>Guest post written by Joseph Finch&lt;br /&gt;&lt;br /&gt;Being a stay at home mom has been kind of draining for me but to be honest, what’s saved me recently is reading. It’s always been a hobby of mine and now that I’m at home all day it’s really what relaxes me more than anything – I get to be transported to a whole different world when I’m curled up on the couch with a good book. My &lt;a href="http://www.cnn.com/2011/09/28/opinion/patterson-kids-reading/index.html"&gt;kids&lt;/a&gt;are at an age where they’re getting into it, too, which makes me really happy because I know how great for them reading is. As a former teacher there are so many developmental things that come from your kids reading books so I’m glad my hobby can serve as a living example for them! I spend most of my days cooking and grocery shopping and looking at &lt;a href="http://www.homesecuritysystem.com/adt-home-security-system/California/S/San-Diego/"&gt;http://www.homesecuritysystem.com&lt;/a&gt; for alarms so it’s nice to have an escape when I need it, and especially one as cheap as books. I love that there are so many different titles and that the library loans them out for free!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-142486057961543580?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/142486057961543580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=142486057961543580' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/142486057961543580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/142486057961543580'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/11/reading-for-me.html' title='Reading for me'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2815323334415527396</id><published>2011-11-06T00:01:00.002-05:00</published><updated>2011-11-06T00:01:40.958-05:00</updated><title type='text'>3 Awk Scripts For Calculating Compound Interest</title><content type='html'>Last year, I posted &lt;a href="http://unix-simple.blogspot.com/2006/09/two-awk-scripts-for-calculating.html"&gt;2 Awk Scripts&lt;/a&gt; for calculating compound interest.&lt;br /&gt;&lt;br /&gt;The "compound" script simply adds compound interest to an initial starting principle.&lt;br /&gt;&lt;br /&gt;The second script, "compound_add", uses the principle value as a regular contribution.  In other words, it adds in this amount each period and then calculates interest on the total.&lt;br /&gt;&lt;br /&gt;I recently created a third script, called "compound_add2".  This script combines the functionality of the 2 previous scripts.  It allows you to add a regular contribution to an account that already has principle.&lt;br /&gt;&lt;br /&gt;Here are some examples of how to use these scripts:&lt;br /&gt;&lt;br /&gt;1. You open a money market account with $5,000 and earn 0.45% / month.  How much is the account worth after 1 year?  You would use "compound 5000 .45 12"&lt;br /&gt;&lt;br /&gt;2. You open a money market account with $200, contribute $200 each month, and earn 0.45% / month.  How much is the account worth after 1 year? You would use "compound_add 200 .45 12"&lt;br /&gt;&lt;br /&gt;3. You have an existing money market account with $5,000.  You now contribute $200 each month and earn 0.45% / month. How much is the account worth after 1 year? You would use "compound_add2 5000 200 .45 12"&lt;br /&gt;&lt;br /&gt;Here is the compound_add2 script:&lt;br /&gt;&lt;br /&gt;BEGIN {&lt;br /&gt;&lt;br /&gt;if (ARGC &lt; 5)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;printf ("Usage: %s start add rate time\n",ARGV[0])&lt;br /&gt;&lt;br /&gt;exit 1&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;start=ARGV[1]&lt;br /&gt;&lt;br /&gt;add=ARGV[2]&lt;br /&gt;&lt;br /&gt;rate=ARGV[3]/100+1&lt;br /&gt;&lt;br /&gt;time=ARGV[4]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;printf ("Start with %.2f.\n",start,rate,time)&lt;br /&gt;&lt;br /&gt;printf ("Amount %.2f added in each time and compounded at %.4f for %d yields: \n\n",add,rate,time)&lt;br /&gt;&lt;br /&gt;total = start&lt;br /&gt;&lt;br /&gt;invest = start&lt;br /&gt;&lt;br /&gt;for (i=1;i&lt;=time; i++)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;total = (add + total)*rate&lt;br /&gt;&lt;br /&gt;invest += add&lt;br /&gt;&lt;br /&gt;printf ("%d: %.2f      (invested: %d)\n", i, total, invest)&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2815323334415527396?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2815323334415527396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2815323334415527396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2815323334415527396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2815323334415527396'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/11/3-awk-scripts-for-calculating-compound.html' title='3 Awk Scripts For Calculating Compound Interest'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8566934302020227666</id><published>2011-11-03T09:59:00.000-05:00</published><updated>2011-11-06T00:00:01.097-05:00</updated><title type='text'>Awk Script For Trading Stocks</title><content type='html'>Besides unix/awk scripting, I also enjoy &lt;a href="http://simple-trading-system.blogspot.com/"&gt;trading stocks&lt;/a&gt;.  Here is an awk program that takes a file of stock prices and applies the &lt;a href="http://simple-trading-system.blogspot.com/2006/07/constant-value-investing.html"&gt;constant value investing algorithm &lt;/a&gt;to them.&lt;span class="fullpost"&gt; &lt;br /&gt;&lt;br /&gt;This script is also included in my book, &lt;a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;amp;location=http%3A%2F%2Fwww.amazon.com%2FStock-Trading-Riches-Powerful-Transforms%2Fdp%2F1434809870%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1193783028%26sr%3D8-2&amp;amp;tag=mysimpletradi-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=9325"&gt;Stock Trading Riches&lt;/a&gt;, which is available on Amazon.com, and outlines my complete stock  trading system.&lt;br /&gt;&lt;br /&gt;You can learn more about my book at &lt;a href="http://www.stocktradingriches.com/"&gt;my trading book's website&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Basically, the technique is to buy a certain control value (in our case $2,000) worth of the stock and then, for each new price, buy or sell shares until we get back to the control value. We will not always rebalance back exactly to the control due to rounding errors, since we cannot own fractional shares of a stock. &lt;br /&gt;&lt;br /&gt;Here is the program:&lt;pre&gt;awk '&lt;br /&gt;BEGIN  {&lt;br /&gt;control = 2000&lt;br /&gt;cash = control&lt;br /&gt;orig = control&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;price = $1&lt;br /&gt;value = shares * price + cash&lt;br /&gt;shares = int(control / price)&lt;br /&gt;cash = value - shares * price&lt;br /&gt;if (cash &lt; 0)&lt;br /&gt;{&lt;br /&gt;value += -1*cash&lt;br /&gt;orig += -1*cash&lt;br /&gt;cash = 0&lt;br /&gt;}&lt;br /&gt;print price"      "shares"        "cash"  "value" "orig&lt;br /&gt;}&lt;/pre&gt;In the begin part (before the file of prices are read in), we set "control" to be the starting amount ($2000).  Then, we set the "cash" and "orig" (amount invested) to also be $2,000.  So, at stage 0 (before we start reading in the file of prices) we have defined that we will hold $2000 worth of the stock and we will not start with any extra cash - only the $2000 needed for our intial purchase.Now, we come to the main section.  Since there is no pattern before the brackets, it means that the steps contained in this second set of brackets will be applied to each line in the file.We first set price to be the first field in the file.  Our assumption is that each line in the file consists of only a stock price.  We ignore everything else on the line.  Then, we caculate the current value of the account.  This will be all shares of stock owned, multiplied by the current stock price, plus any cash.  When we read in the first price from the file (line 1), this calculation will be: value = 0 * first_price + 2000 = 2000This is because we start out with no stock, and all our starting money in cash.Then, we set the number of shares to be the control (2000) divided by the share price, and we round.  So, for example, if the first price was $10, then we would change shares from 0 to 2000/10 = 200.Next, we adjust cash to reflect buying/selling to reach our new share value (and establish a stock value equal to the control).  In the above example, the first price is $10, so we changed shares from 0 to 200.  Now we would set cash = value - shares * price = 2000 - 200*10 = 0 (remember multiplication is done before subtraction).In the next step, we check if cash is negative.  This would mean that the stock price went down, we bought more stock, and did not have the cash to pay for it.  We now have to add more cash into the account and need to update the value and orig (which is the amount we invested).Finally, after processing each price, we print out the status of the account.Here is &lt;a href="http://simple-trading-system.blogspot.com/2006/07/example-of-constant-value-investing.html"&gt;an example &lt;/a&gt;, as applied to &lt;a href="http://www.amazon.com/exec/obidos/redirect-home?site=amazon&amp;tag=mysimpletradi-20/"&gt;Amazon.com &lt;/a&gt;(AMZN) yearly prices.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8566934302020227666?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8566934302020227666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8566934302020227666' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8566934302020227666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8566934302020227666'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/11/awk-script-for-trading-stocks.html' title='Awk Script For Trading Stocks'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5579986815567371136</id><published>2011-10-31T11:18:00.000-05:00</published><updated>2011-10-31T11:18:34.111-05:00</updated><title type='text'>Internet Sites Should Focus on One Product Line</title><content type='html'>I like to regularly highlight internet websites that are successful because they keep their business model simple and focus on one thing.&lt;br /&gt;&lt;br /&gt;Today's example is &lt;a href="http://www.blueskyscrubs.com/categories/Scrubs/Scrubs-for-Women/"&gt;http://www.blueskyscrubs.com/categories/Scrubs/Scrubs-for-Women/&lt;/a&gt;&lt;br /&gt;which specializes in the narrowly targeted niche of &lt;a href="http://www.blueskyscrubs.com/categories/Scrubs/Scrubs-for-Women/"&gt;nursing scrubs&lt;/a&gt; - including medical lab coats, nurse uniforms, and other accessories.&lt;br /&gt;&lt;br /&gt;Because Blue Sky Scrubs keeps it simple and specialized, their website is clutter free, well organized, and easy to navigate.  &lt;br /&gt;&lt;br /&gt;Someone interested in scrubs can quickly find and buy what they are looking for, a lot easier than shopping at a website that sells general merchandise.&lt;br /&gt;&lt;br /&gt;As a further advantage, having so many interlinked pages on the same subject will help to get them ranked as more relevant for their key search terms.&lt;br /&gt;&lt;br /&gt;That s why specialized websites are a good business model.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5579986815567371136?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5579986815567371136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5579986815567371136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5579986815567371136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5579986815567371136'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/10/internet-sites-should-focus-on-one.html' title='Internet Sites Should Focus on One Product Line'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-773685269175966826</id><published>2011-10-31T11:15:00.001-05:00</published><updated>2011-10-31T11:15:11.012-05:00</updated><title type='text'>Forwarding Webpages with JavaScript</title><content type='html'>Here is a simple javascript that will randomly forward you to either yahoo (50% of time) or google (50%).  This could be used for &lt;a href="http://simple-trading-system.blogspot.com/2008/04/how-to-test-websites-part-1-split.html"&gt;split testing websites&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;&lt;br /&gt;//--&amp;gt;&lt;br /&gt;&lt;br /&gt;var i = Math.round(100*Math.random());&lt;br /&gt;&lt;br /&gt;if (i&lt;=50){window.location="http://www.yahoo.com";}if (i&gt;50)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;window.location="http://www.google.com";&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-773685269175966826?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/773685269175966826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=773685269175966826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/773685269175966826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/773685269175966826'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/10/forwarding-webpages-with-javascript.html' title='Forwarding Webpages with JavaScript'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8007453775490100273</id><published>2011-10-31T08:03:00.001-05:00</published><updated>2011-10-31T08:03:55.889-05:00</updated><title type='text'>More Halloween Fun</title><content type='html'>Ben and Jerry's Halloween interactive website:&lt;br /&gt;&lt;br /&gt;&lt;a target="_blank" href="http://www.benjerry.com/halloween/"&gt;http://www.benjerry.com/halloween/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8007453775490100273?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8007453775490100273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8007453775490100273' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8007453775490100273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8007453775490100273'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/10/more-halloween-fun.html' title='More Halloween Fun'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2956712387978864966</id><published>2011-10-31T00:44:00.002-05:00</published><updated>2011-10-31T00:44:31.234-05:00</updated><title type='text'>Happy Halloween!</title><content type='html'>I publish this link on my blogs every year at Halloween time, it's pretty cool:&lt;br /&gt;&lt;br /&gt;&lt;a target="_blank" href="http://ak.imgag.com/imgag/product/preview/flash/bws8Shell.swf?ihost=http%3A%2F%2Fak.imgag.com%2Fimgag&amp;brandldrPath=%2Fproduct%2Ffull%2Fel%2F&amp;cardNum=%2Fproduct%2Ffull%2Fap%2F3125133%2Fgraphic1"&gt;http://ak.imgag.com/imgag/product/preview/flash/bws8Shell.swf?ihost=http%3A%2F%2Fak.imgag.com%2Fimgag&amp;brandldrPath=%2Fproduct%2Ffull%2Fel%2F&amp;cardNum=%2Fproduct%2Ffull%2Fap%2F3125133%2Fgraphic1&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2956712387978864966?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2956712387978864966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2956712387978864966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2956712387978864966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2956712387978864966'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/10/happy-hallowen.html' title='Happy Halloween!'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4298041109003156450</id><published>2011-10-23T23:51:00.000-05:00</published><updated>2011-10-23T23:51:22.374-05:00</updated><title type='text'>The Middle East and Internet Marketing</title><content type='html'>The headlines these days are all about the Arab Spring - where many Middle East countries are overthrowing their long time dictators in exchange for a shot at democracy.&lt;br /&gt;&lt;br /&gt;But, the Middle East is also having an economic and technical rebirth to go along with the political one.  This filters down to the internet.&lt;br /&gt;&lt;br /&gt;Businesses are increasing their spending on advertising for &lt;a href="http://www.levantdigital.com/"&gt;internet marketing in the Middle East&lt;/a&gt;, as well as &lt;a href="http://www.levantdigital.com/"&gt;social marketing in the Middle East&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4298041109003156450?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4298041109003156450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4298041109003156450' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4298041109003156450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4298041109003156450'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/10/middle-east-and-internet-marketing.html' title='The Middle East and Internet Marketing'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8824607116389076229</id><published>2011-10-15T22:25:00.000-05:00</published><updated>2011-10-23T22:25:38.652-05:00</updated><title type='text'>Part 2 - Creating An SQL Report Using Only Sqlplus</title><content type='html'>In &lt;a href="http://unix-simple.blogspot.com/2010/01/sql-and-unix-shell-vs-sql-only-part-i.html"&gt;part 1&lt;/a&gt;, I outlined the need to extract siteid / templatename combinations from an Oracle database table, and then group identical records and print the count.&lt;br /&gt;&lt;br /&gt;I offered the solution where I pulled all records by running SQLPlus in a unix shell, and piping the output to grep, then to sort, and finally to uniq -c.&lt;br /&gt;&lt;br /&gt;Here is the ideal situation, because it's done completely through SQL:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;select count(*),templatename,siteid from transactiontemplategroups&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;group by templatename,siteid&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;having count(*) &gt; 1&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8824607116389076229?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8824607116389076229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8824607116389076229' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8824607116389076229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8824607116389076229'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/10/part-2-creating-sql-report-using-only.html' title='Part 2 - Creating An SQL Report Using Only Sqlplus'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8772124073320135820</id><published>2011-10-03T08:23:00.000-05:00</published><updated>2011-10-23T22:24:30.650-05:00</updated><title type='text'>Part 1 - Creating An SQL Report Using Both Sqlplus and Unix Shell Scripts</title><content type='html'>Yesterday, I had to run a query in an Oracle database to find templates that are in more than one template group.&lt;br /&gt;&lt;br /&gt;The data is stored in a table called "TransactionTemplateGroups" and the three fields are siteid, templatename, and groupname.&lt;br /&gt;&lt;br /&gt;We are interested in duplicate siteid/templatename combinations.  That means, for a particular site, the same name has more than one record (i.e. in more than one group).&lt;br /&gt;&lt;br /&gt;So, my first solution was a combination SQL piped to shell scripts.&lt;br /&gt;&lt;br /&gt;The SQL was:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;select siteid||'%'||templatename from transactiontemplategroups;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This returns all instances of sites/templates separated by a % character (I used a char because template names contain spaces).&lt;br /&gt;&lt;br /&gt;I then piped this to:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;grep %|sort|uniq -c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This made sure to only include data lines (exclude extra messages from SQLplus), sorted the data, and then combines identical lines into one line with the count.&lt;br /&gt;&lt;br /&gt;At this point, I now have every siteid, templatename combo written once, with the count.&lt;br /&gt;&lt;br /&gt;This is what I wanted but, I had problems importing them into a spreadsheet because even % was used in some template names.  In fact, because it is a large amount of data (thousands of records), all chars - even *, etc. are used in names.&lt;br /&gt;&lt;br /&gt;I ended up finding an all SQL solution that allowed me to run the query on my PC in TOAD (Tool of Oracle Application Developers) and import it directly in Excel.&lt;br /&gt;&lt;br /&gt;Here is &lt;a href="http://unix-simple.blogspot.com/2010/01/sql-and-unix-shell-vs-sql-only-part-2.html"&gt;part 2&lt;/a&gt; where I give the all SQL solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8772124073320135820?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8772124073320135820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8772124073320135820' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8772124073320135820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8772124073320135820'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/10/part-1-creating-sql-report-using-both.html' title='Part 1 - Creating An SQL Report Using Both Sqlplus and Unix Shell Scripts'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-3541873805462189651</id><published>2011-09-20T01:09:00.000-05:00</published><updated>2011-09-20T01:09:35.700-05:00</updated><title type='text'>Combining Search Engine Optimization With Web 2.0</title><content type='html'>Even though social networks and "web 2.0" are now such an important part of the internet, &lt;a href="http://www.wpromote.com/"&gt;search engine marketing firm&lt;/a&gt;s are as important as ever.  In fact, social buzz and &lt;a href="http://www.wpromote.com/"&gt;SEO&lt;/a&gt; are two parts of the ultimate goal of attracting traffic to the web site - and they feed each other in a positive cycle.&lt;br /&gt;&lt;br /&gt;While the &lt;a href="http://www.wpromote.com/"&gt;search engine optimization firm&lt;/a&gt; does their part - getting the website ranked higher by the major search engines - the content creator running the site does his part - creating valuable content that encourages visitors to communicate about the site, and pass out links, to their social connections.&lt;br /&gt;&lt;br /&gt;This primarily involves 2 activities: encouraging the creation of content that excites your target audience, and providing widgets or links that allow them to easily share your content with one click (for example, a "like" icon to share to Facebook).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-3541873805462189651?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/3541873805462189651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=3541873805462189651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3541873805462189651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3541873805462189651'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/09/combining-search-engine-optimization.html' title='Combining Search Engine Optimization With Web 2.0'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6797735334098268209</id><published>2011-09-20T00:54:00.002-05:00</published><updated>2011-09-20T00:54:57.906-05:00</updated><title type='text'>Handy Settings For Your Korn Shell .kshrc File</title><content type='html'>My co-worker had modified his .kshrc by adding the following four entries (highlighted in &lt;span style="font-weight:bold;"&gt;bold&lt;/span&gt;):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;alias -x ll='ls -l'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;umask 002&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;stty erase "^H" kill "^U" intr "^C" eof "^D" quit "^\\" susp "^Z"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;PS1="\\&lt;br /&gt;\$PWD \\&lt;br /&gt;`hostname`:[\!]-&gt; "&lt;br /&gt;export PS1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The first entry set an alias of "ll", so "ll" could be run like a command.  It would do the long list function (ls -l).&lt;br /&gt;&lt;br /&gt;The umask sets it so that files are created with a default permission of rw-rw-r--&lt;br /&gt;and directories are created with drwxrwxr-x.&lt;br /&gt;&lt;br /&gt;The stty line sets the terminal characteristics, so that his unix window's backspace key will work.&lt;br /&gt;&lt;br /&gt;Finally, it sets the main command prompt(PS1) to always display the current directory, the machine name, last command process, and a -&gt; for entering the command.&lt;br /&gt;&lt;br /&gt;For example, if you were currently in the /etc directory, and your unix machine was called "donut", your command prompt would look like:&lt;br /&gt;&lt;br /&gt;/etc &lt;br /&gt;donut:[583]-&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6797735334098268209?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6797735334098268209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6797735334098268209' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6797735334098268209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6797735334098268209'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/09/handy-settings-for-your-korn-shell.html' title='Handy Settings For Your Korn Shell .kshrc File'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6976512924116053299</id><published>2011-09-20T00:52:00.000-05:00</published><updated>2011-09-20T00:52:24.294-05:00</updated><title type='text'>Multiple - Word Command Arguments in Unix</title><content type='html'>Did you know that unix command line arguments can be more than one word?  You can group text separated by spaces into a single argument by surrounding the text with quotes.&lt;br /&gt;&lt;br /&gt;For example, what are the differences between these argument lists?&lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;boy girl&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;boy dog girl&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;"boy dog" girl&lt;/div&gt;&lt;br /&gt;In the first example, we have two arguments: &lt;span style="color: red;"&gt;boy&lt;/span&gt; and&lt;span style="color: red;"&gt; girl&lt;/span&gt;.  In the second example, we have three arguments: &lt;span style="color: red;"&gt;boy&lt;/span&gt;, &lt;span style="color: red;"&gt;dog&lt;/span&gt;, and &lt;span style="color: red;"&gt;girl&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In the third example, we have two arguments: &lt;span style="color: red;"&gt;boy dog&lt;/span&gt; and &lt;span style="color: red;"&gt;girl&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6976512924116053299?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6976512924116053299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6976512924116053299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6976512924116053299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6976512924116053299'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/09/multiple-word-command-arguments-in-unix.html' title='Multiple - Word Command Arguments in Unix'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-1137483511961613261</id><published>2011-09-18T21:55:00.002-05:00</published><updated>2011-09-18T21:55:56.770-05:00</updated><title type='text'>An Advertising Agency  That Understands The Internet</title><content type='html'>I was just reading a website of an &lt;a href="http://www.ThatAdvertisingAgency.com"&gt;Advertising Agency&lt;/a&gt; that seems to understand that the internet is changing the media world.&lt;br /&gt;&lt;br /&gt;Their website itself shows that they understand the internet.  Their website isn't flashy, with whiz bang effects that take time to load.  Instead, there website is simple, and to the point.&lt;br /&gt;&lt;br /&gt;They make a good point about the importance of an agency created in the digital age.  In the old days, there were only a few TV channels.  TV, radio, and newspapers did not have to compete with internet surfing, podcasts, or interactive online games.  People had longer attention spans.  You could advertise in the mass media and reach a lot of people.  &lt;br /&gt;&lt;br /&gt;Today, there are plenty of specialized cable channels, and plenty of online alternatives.  Audiences are fragmented.  Now, instead of trying to reach a lot of people with a mainstream commercial, the best way to reach people is to create targeted commercials and run them in these different niche media outlets.&lt;br /&gt;&lt;br /&gt;Digital media is now interactive, and gives advertisers the tools to track the effectiveness of campaigns.&lt;br /&gt;&lt;br /&gt;In this new environment, if you use a standard &lt;a href="http://www.ThatAdvertisingAgency.com"&gt;Advertising Agency&lt;/a&gt; that uses the old techniques, your advertising won't be as effective as it could be.  For example, you would not want your agency to create bland, generic advertisements that are not targeted to anyone in particular, and then try to run them on different channels.&lt;br /&gt;&lt;br /&gt;Instead, this &lt;a href="http://www.ThatAdvertisingAgency.com"&gt;ad agency&lt;/a&gt; would probably create an ad that appeals, for example, to fans of cooking shows and run that on the cooking channels.  They could create another commercial for home and garden channels, etc.&lt;br /&gt;&lt;br /&gt;This particular agency would also use online tools to track traffic and conversions for online advertising.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-1137483511961613261?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/1137483511961613261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=1137483511961613261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1137483511961613261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1137483511961613261'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/09/advertising-agency-that-understands.html' title='An Advertising Agency  That Understands The Internet'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6664364395060701644</id><published>2011-09-18T21:26:00.003-05:00</published><updated>2011-09-18T21:28:27.119-05:00</updated><title type='text'>Using Awk to Filter A Long Directory Listing, and Strip Out The File Name</title><content type='html'>Today, a guy at work used &lt;span style="font-weight: bold;"&gt;ls -ltr&lt;/span&gt; to list the files in a directory, and then saved the list to a file.&lt;br /&gt;&lt;br /&gt;He then used &lt;span style="font-weight: bold;"&gt;grep 'Jan 17' file&lt;/span&gt; to get the files from today.&lt;br /&gt;&lt;br /&gt;He got a listing like:&lt;br /&gt;&lt;br /&gt;-&lt;span style="color: rgb(255, 0, 0);"&gt;rw-r--r--&amp;nbsp;&amp;nbsp; 1 dirdev&amp;nbsp;&amp;nbsp; cpadev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2610 Jan 17 13:34 1169058858923.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-rw-r--r--&amp;nbsp;&amp;nbsp; 1 dirdev&amp;nbsp;&amp;nbsp; cpadev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1874 Jan 17 13:51 1169059879810.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-rw-r--r--&amp;nbsp;&amp;nbsp; 1 dirdev&amp;nbsp;&amp;nbsp; cpadev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2060 Jan 17 14:03 1169060634579.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-rw-r--r--&amp;nbsp;&amp;nbsp; 1  dirdev&amp;nbsp;&amp;nbsp; cpadev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2060 Jan 17 14:04 1169060654514.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-rw-r--r--&amp;nbsp;&amp;nbsp; 1 dirdev&amp;nbsp;&amp;nbsp; cpadev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2051 Jan 17 14:09 1169060951871.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-rw-r--r--&amp;nbsp;&amp;nbsp; 1 dirdev&amp;nbsp;&amp;nbsp; cpadev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2086 Jan 17 14:13 1169061191628.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-rw-r--r--&amp;nbsp;&amp;nbsp; 1 dirdev&amp;nbsp;&amp;nbsp; cpadev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2774 Jan 17 14:15 1169061335728.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-rw-r--r--&amp;nbsp;&amp;nbsp; 1 dirdev&amp;nbsp;&amp;nbsp; cpadev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2776 Jan 17 14:21 1169061678596.xml&lt;/span&gt;&lt;br style="color:  rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-rw-r--r--&amp;nbsp;&amp;nbsp; 1 dirdev&amp;nbsp;&amp;nbsp; cpadev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2705 Jan 17 14:28 1169062086415.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-rw-r--r--&amp;nbsp;&amp;nbsp; 1 dirdev&amp;nbsp;&amp;nbsp; cpadev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2818 Jan 17 14:33 1169062396259.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But he only wants the filenames, like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;1169058858923.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;  1169059879810.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; 1169060634579.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;  1169060654514.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; 1169060951871.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0,  0);"&gt; 1169061191628.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;  1169061335728.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;  1169061678596.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;  1169062086415.xml&lt;/span&gt;&lt;br style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; 1169062396259.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I told him to not use grep and, instead, use this awk statement:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;awk '/Jan 17/ {print $NF}' file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This works because the &lt;span style="font-weight: bold;"&gt;/Jan 17/&lt;/span&gt;&amp;nbsp; works like the grep.&amp;nbsp; Since, &lt;span style="font-weight: bold;"&gt;NF&lt;/span&gt; is equal to the number of fields (in this case 9), &lt;span style="font-weight: bold;"&gt;$NF&lt;/span&gt; references the last field.&amp;nbsp; Since the name is in the last field, &lt;span style="font-weight: bold;"&gt;print $NF&lt;/span&gt; returns the file name.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6664364395060701644?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6664364395060701644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6664364395060701644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6664364395060701644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6664364395060701644'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/09/using-awk-to-filter-long-directory.html' title='Using Awk to Filter A Long Directory Listing, and Strip Out The File Name'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-7222087952127387160</id><published>2011-09-17T00:08:00.000-05:00</published><updated>2011-09-17T00:08:14.664-05:00</updated><title type='text'>Search Marketing Firm Helps Customers Optimize for Social Media</title><content type='html'>Social networks and "web 2.0" are now such an important part of the internet, that at least one search optimization / &lt;a href="http://newsofthewired.com/the-basics-of-social-media-optimization-for-merchants"&gt;search engine marketing firm&lt;/a&gt; is now advising its clients on how to design a &lt;a href="http://newsofthewired.com/the-basics-of-social-media-optimization-for-merchants"&gt;social media friendly site&lt;/a&gt;.  This as part of the ultimate goal of attracting traffic to the web site.&lt;br /&gt;&lt;br /&gt;While the search engine optimization part of their service is still concerned with getting the website ranked higher by the major search engines, the newly created &lt;a href="http://newsofthewired.com/the-basics-of-social-media-optimization-for-merchants"&gt;social media optimization&lt;/a&gt; part is concerned with encouraging visitors to communicate about the site, and pass out links, to their social connections.&lt;br /&gt;&lt;br /&gt;This primarily involves 2 activities: encouraging the creation of content that excites your target audience, and providing widgets or links that allow them to easily share your content with one click (for example, a "like" icon to share to Facebook).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-7222087952127387160?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/7222087952127387160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=7222087952127387160' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7222087952127387160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7222087952127387160'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/09/search-marketing-firm-helps-customers.html' title='Search Marketing Firm Helps Customers Optimize for Social Media'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4673727234659444631</id><published>2011-09-16T23:48:00.000-05:00</published><updated>2011-09-16T23:48:20.226-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix Shell'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Creating csv Files From Unix When the Data Has Commas</title><content type='html'>Here is a problem that has occurred a few times for me:&lt;br /&gt;&lt;br /&gt;I run a query on a unix database using sqlplus from a shell script.  I then save the results in an csv (comma separated value) file and load it into Excel.  What I find is that some rows have extra columns.&lt;br /&gt;&lt;br /&gt;The reason it happened is that some data contains commas.&lt;br /&gt;&lt;br /&gt;Here is a way to prevent this:&lt;br /&gt;&lt;br /&gt;1. Extract the data with a &lt;b&gt;%&lt;/b&gt; (or other symbol) separating the data.&lt;br /&gt;&lt;br /&gt;   i.e.  select field1||'%'||field2||'%'||field3 from table&lt;br /&gt;&lt;br /&gt;2. Use sed (unix stream editor) to remove all commas, and then convert the %'s into commas:&lt;br /&gt;&lt;br /&gt;   cat sqlfile | sed 's/,//g' | sed 's/%/,/g'&lt;br /&gt;&lt;br /&gt;Then, your columns should line up in excel because the data will no longer contain commas.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4673727234659444631?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4673727234659444631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4673727234659444631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4673727234659444631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4673727234659444631'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/09/creating-csv-files-from-unix-when-data.html' title='Creating csv Files From Unix When the Data Has Commas'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2214126811762138113</id><published>2011-09-16T22:55:00.000-05:00</published><updated>2011-09-16T22:55:05.298-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix Shell'/><title type='text'>Using uuencode to Mail Attachments From Unix Shell Scripts</title><content type='html'>At work, I frequently have to do queries on an Oracle database, and send out the results in a spreadsheet.  &lt;br /&gt;&lt;br /&gt;If the report can be done with SQL alone, I usually do the report on my PC using TOAD (Tool for Oracle Admins and Developers).  TOAD lets you save the results as an excel spreadsheet.&lt;br /&gt;&lt;br /&gt;If, however, the report was complex where it required manipulating the output through unix shell / awk scripts, or I wanted to automate the report, I had to run the query from unix through sqlplus.  If I then mailed the report from unix, the data would be in the body of the email.  This isn't good if the report had a lot of columns.&lt;br /&gt;&lt;br /&gt;I recently found a solution.  It is a unix utility called uuencode, which let's you send data as an attachment.  By sending the report as a csv (comma separated values) file, the email will appear in Outlook on my PC with an attachment that will open in Excel with one click.&lt;br /&gt;&lt;br /&gt;Here are two ways to use it (assume that the report was saved in a text file called rptfile, and all data are separated by commas):&lt;br /&gt;&lt;br /&gt;&lt;b&gt;uuencode rptfile report.csv | /usr/ucb/mailx -s $SUBJ $MAIL_LIST&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;(cat bodyfile; uuencode rptfile report.csv) | /usr/ucb/mailx -s $SUBJ $MAIL_LIST&lt;br /&gt;&lt;br /&gt;The first way sends an empty email with report.csv as an attachment.  The second one also sends an email with report.csv as an attachment, but the email also has the contents of bodyfile in the body of the email.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2214126811762138113?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2214126811762138113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2214126811762138113' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2214126811762138113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2214126811762138113'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/09/using-uuencode-to-mail-attachments-from.html' title='Using uuencode to Mail Attachments From Unix Shell Scripts'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-3111797845754160043</id><published>2011-09-15T16:00:00.001-05:00</published><updated>2011-09-15T16:00:59.183-05:00</updated><title type='text'>NET10 - Example of Simple Technology and Products</title><content type='html'>    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;      &lt;p&gt;This is a Sponsored post written by me on behalf of &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=5644592'&gt;Net10&lt;/a&gt; for &lt;a rel='nofollow' href='http://izea.in/rXJg'&gt;SocialSpark&lt;/a&gt;. All opinions are 100% mine.&lt;/p&gt;      &lt;p&gt;	I enjoy hearing about businesses that find a way to simplify a product and service down to the essentials, and then offer a great value to consumers.&lt;br/&gt;&lt;br/&gt;	    NET10 has done just that with cell phones.  They offer phone service without a contract for less than what other large carriers cost.  They make it simple to understand, with no charges hidden in complexity.  For example, there are no activation or termination fees.&lt;br/&gt;&lt;br/&gt;	   &lt;br/&gt;	    &lt;br/&gt;	    NET10 offers the choice of their Easy Minutes Plan ($15/200 minutes), pay-as-you-go plans, or an "all you can eat" unlimited plan for only $50!&lt;br/&gt;&lt;br/&gt;	    For that $50, you can talk, send text messages, and surf the web as much as you want.&lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=16942&amp;amp;oid=5644592'&gt;Cute NET10 commercial&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	 So, what's the catch?  Well, you might expect that the only phones available for the plan are old, outdated ones that lack smart features.  But that's simply not true - NET10 offers phones from LG, Motorola, Kyocera, Nokia and Samsung that have all modern features - including cameras and web browsers.&lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=16952&amp;amp;oid=5644592'&gt;Real NET10 customer&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	  &lt;br/&gt;	They offer different price tiers - such as under $15, under $40, or under $60, so you can choose how simple or feature filled you want your phone to be.&lt;/p&gt;      &lt;p&gt;	Net10 offers 15 cent per minute calling to 75 different countries, as well as an international neighbors plan that allows people in Canada and Mexico to call you with a local number.&lt;/p&gt;      &lt;p&gt;	A great way to find out more about NET10 is to join them on Twitter (&lt;a href='http://twitter.com/#!/Net10_Wireless'&gt;http://twitter.com/#!/Net10_Wireless&lt;/a&gt;) an Facebook (&lt;a href='https://www.facebook.com/NET10Wireless'&gt;https://www.facebook.com/NET10Wireless&lt;/a&gt;).&lt;/p&gt;      &lt;p&gt;	&amp;lt;iframe width="420" height="345" src="http://www.youtube.com/embed/JWev3ZyAOeY" frameborder="0" allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;      &lt;p&gt;  &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=5644592'&gt;    &lt;img style='border:none;' src='http://app.socialspark.com/views?oid=5644592' border='0' alt='Visit Sponsor&amp;apos;s Site'/&gt;  &lt;/a&gt;&lt;/p&gt;    &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-3111797845754160043?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/3111797845754160043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=3111797845754160043' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3111797845754160043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3111797845754160043'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/09/net10-example-of-simple-technology-and.html' title='NET10 - Example of Simple Technology and Products'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5892947144436099283</id><published>2011-08-28T11:19:00.000-05:00</published><updated>2011-08-28T11:19:26.414-05:00</updated><title type='text'>Texas is great</title><content type='html'>This guest post from Werner Rogers&lt;br /&gt;&lt;br /&gt;If you’ve never been out to Texas, than you are missing out on seeing the greatest state in the U.S. Although maybe I shouldn’t tell you about it because we’re already kind of overcrowded. However, because I like to share good things with people, I’m going to go ahead and tell you that the best place in the entire world to live is Austin, Texas. It’s the perfect combination of southern charm and city bustle. The people there are amazing, and they love sharing their home town with people. There’s always something to do, and the night life is amazing. So many people are active, too, and healthy food rules over fried. So you get the &lt;a href="http://www.southernfoods.com/products.php"&gt;southern&lt;/a&gt; feel without the waist line. I recently bought a house there because I love it so much, and wanted to share with you how I found my energy service provider (&lt;a href="http://www.shopelectricityratestexas.com/texas-electricity-rates/Texas/E/El-Paso/"&gt;http://www.shopElectricityRatesTexas.com&lt;/a&gt;) to make it easier if you feel like moving to the greatest state in the continental U.S! Welcome to Texas- your future home if you are smart!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5892947144436099283?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5892947144436099283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5892947144436099283' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5892947144436099283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5892947144436099283'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/08/texas-is-great.html' title='Texas is great'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-7055802421493310752</id><published>2011-08-28T11:15:00.002-05:00</published><updated>2011-08-28T11:15:58.636-05:00</updated><title type='text'>Embedding Data Directly In A Unix Shell Script</title><content type='html'>The Unix shell has what is called a "here-document" function which allows you to put input under a command, instead of in a separate text file, and feed it into the program.&lt;br /&gt;&lt;br /&gt;This is done by placing a "&amp;lt;&amp;lt;" and a character string after the command.&amp;nbsp; Then, every line after the command is interpreting as free-form text to be fed into the command, until a line is hit that has the character string.&lt;br /&gt;&lt;br /&gt;For example,&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 127, 64);"&gt;awk '{print $1}' &amp;lt;&amp;lt;!&lt;/span&gt;&lt;br style="color: rgb(0, 127, 64);"&gt;&lt;span style="color: rgb(0, 127, 64);"&gt;jack be&lt;/span&gt;&lt;br style="color: rgb(0, 127, 64);"&gt;&lt;span style="color: rgb(0, 127, 64);"&gt;nimble jack be&lt;/span&gt;&lt;br style="color: rgb(0, 127, 64);"&gt;&lt;span style="color: rgb(0, 127, 64);"&gt;quick.&lt;/span&gt;&lt;br style="color: rgb(0, 127, 64);"&gt;&lt;span style="color: rgb(0, 127, 64);"&gt;!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Would behave exactly like&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 127, 64);"&gt;awk '{print $1}' &amp;lt;  file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;where the file would contain:&lt;br /&gt;&lt;br /&gt;j&lt;span style="color: rgb(0, 127, 64);"&gt;ack be&lt;/span&gt;&lt;br style="color: rgb(0, 127, 64);"&gt;&lt;span style="color: rgb(0, 127, 64);"&gt; nimble jack be&lt;/span&gt;&lt;br style="color: rgb(0, 127, 64);"&gt;&lt;span style="color: rgb(0, 127, 64);"&gt; quick.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-7055802421493310752?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/7055802421493310752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=7055802421493310752' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7055802421493310752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7055802421493310752'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/08/embedding-data-directly-in-unix-shell.html' title='Embedding Data Directly In A Unix Shell Script'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-1353173199006125814</id><published>2011-08-28T11:14:00.000-05:00</published><updated>2011-08-28T11:14:02.449-05:00</updated><title type='text'>length() Function in AWK</title><content type='html'>Awk has a &lt;i&gt;length&lt;/i&gt; function which returns the length of the argument.&lt;br /&gt;&lt;br /&gt;Here is an example:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;nawk '&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;BEGIN {&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;r="praveen"&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;if (length(r) &amp;gt; 6)&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;print substr(r,3)&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;else&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;print length(r)&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;}'&lt;/div&gt;&lt;br /&gt;This awk script sets the variable &lt;i&gt;r&lt;/i&gt; equal to my first name ("praveen").  It then checks if the length of &lt;i&gt;r&lt;/i&gt; is greater than 6 characters.  &lt;br /&gt;&lt;br /&gt;If it is, then the script prints the string - starting with the third character.  In other words, it skips the first 2 characters.&lt;br /&gt;&lt;br /&gt;If length of &lt;i&gt;r&lt;/i&gt; is not greater than 6 characters, then the whole string is printed.&lt;br /&gt;&lt;br /&gt;In the case of "praveen", it is 7 characters, so the script outputs "aveen".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-1353173199006125814?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/1353173199006125814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=1353173199006125814' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1353173199006125814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1353173199006125814'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/08/length-function-in-awk.html' title='length() Function in AWK'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8774586217392837705</id><published>2011-08-22T01:01:00.002-05:00</published><updated>2011-08-22T01:01:53.170-05:00</updated><title type='text'>A Website That Focuses on One Thing</title><content type='html'>I like to regularly highlight internet websites that are successful because they keep their business model simple and focus on one thing.&lt;br /&gt;&lt;br /&gt;Today's example is &lt;a href="http://www.blueskyscrubs.com/categories/Scrubs/Scrubs-for-Women/"&gt;http://www.blueskyscrubs.com/categories/Scrubs/Scrubs-for-Women/&lt;/a&gt;&lt;br /&gt;which specializes in the narrowly targeted niche of &lt;a href="http://www.blueskyscrubs.com/categories/Scrubs/Scrubs-for-Women/"&gt;nursing scrubs&lt;/a&gt; - including medical lab coats, nurse uniforms, and other accessories.&lt;br /&gt;&lt;br /&gt;Because Blue Sky Scrubs keeps it simple and specialized, their website is clutter free, well organized, and easy to navigate.  &lt;br /&gt;&lt;br /&gt;Someone interested in scrubs can quickly find and buy what they are looking for, a lot easier than shopping at a website that sells general merchandise.&lt;br /&gt;&lt;br /&gt;As a further advantage, having so many interlinked pages on the same subject will help to get them ranked as more relevant for their key search terms.&lt;br /&gt;&lt;br /&gt;That s why specialized websites are a good business model.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8774586217392837705?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8774586217392837705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8774586217392837705' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8774586217392837705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8774586217392837705'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/08/website-that-focuses-on-one-thing.html' title='A Website That Focuses on One Thing'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-3291544057938477616</id><published>2011-08-22T00:58:00.002-05:00</published><updated>2011-08-22T00:58:52.615-05:00</updated><title type='text'>Multiple Command Execution in Unix</title><content type='html'>Let's look at some ways to run unix commands on the same command prompt. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ cmd1 &amp;amp; cmd2 &amp;amp;&lt;br /&gt;&lt;br /&gt;This will run both commands in the background, in parallel.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ cmd1; cmd2&lt;br /&gt;&lt;br /&gt;This will first run cmd1, and then cmd2.&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&amp;nbsp; It is the equivalent of running&amp;nbsp;&lt;span style="font-style: italic;"&gt;&lt;/span&gt; cmd1 on the command prompt, pressing return, and then&lt;span style="font-style: italic;"&gt; &lt;/span&gt;running cmd2&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;at the next command prompt.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ cmd1 &amp;amp;&amp;amp; cmd2&lt;br /&gt;&lt;br /&gt;This will run cmd1 first.&amp;nbsp; If cmd1 runs successfully (return code 0), then cmd2 is run.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ cmd1 || cmd2&lt;br /&gt;&lt;br /&gt;This will run cmd1 first.&amp;nbsp; If cmd1 runs un-successfully (non-zero return code), then cmd2 is run.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-3291544057938477616?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/3291544057938477616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=3291544057938477616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3291544057938477616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3291544057938477616'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/08/multiple-command-execution-in-unix.html' title='Multiple Command Execution in Unix'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8575173596198610910</id><published>2011-08-10T17:36:00.002-05:00</published><updated>2011-08-10T17:36:09.887-05:00</updated><title type='text'>Most Recent File In A Unix Directory</title><content type='html'>&lt;div&gt;If you want to select the most recent file in a directory, you can use:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;em&gt;ls -rt | tail -1&lt;/EM&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The &lt;em&gt;ls -rt&lt;/EM&gt; will list the directory from oldest file to newest file.&amp;nbsp; This command by itself is very handy if you are interesting in listing the most recent files in a directory with many files.&amp;nbsp; This way, you can see the most recent files without scrolling.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Piping a command to &lt;em&gt;tail -x&lt;/EM&gt; will return the last &lt;em&gt;x&lt;/EM&gt; lines of output. so, &lt;em&gt;tail -1&lt;/EM&gt; will return the last line of output.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Together, &lt;em&gt;ls -rt | tail -1&lt;/EM&gt; will return the most recent file.&amp;nbsp; Of course, you can always add qualifiers to the &lt;em&gt;ls&lt;/EM&gt; command, like &lt;em&gt;ls -rt *.log&lt;/EM&gt; to get only &lt;em&gt;.log&lt;/EM&gt; files.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;you can feed this combination into another command, such as the &lt;em&gt;vi&lt;/EM&gt; editor, using back ticks  (`).&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;So, the command &lt;em&gt;vi `ls -rt *.log | tail -1`&lt;/EM&gt;&amp;nbsp; will guarantee that you edit the most recent log file in the directory.&amp;nbsp; This is very handy if you are debugging a problem and running a program multiple times.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8575173596198610910?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8575173596198610910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8575173596198610910' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8575173596198610910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8575173596198610910'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/08/most-recent-file-in-unix-directory.html' title='Most Recent File In A Unix Directory'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-9068883977202698960</id><published>2011-08-02T19:01:00.001-05:00</published><updated>2011-08-02T19:01:54.429-05:00</updated><title type='text'>How to Save on Cell Phone Plans</title><content type='html'>    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;      &lt;p&gt;This is a Sponsored post written by me on behalf of &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=4585212'&gt;Straight Talk&lt;/a&gt; for &lt;a rel='nofollow' href='http://izea.in/rXJg'&gt;SocialSpark&lt;/a&gt;. All opinions are 100% mine.&lt;/p&gt;      &lt;p&gt;	For about half the price of other cell phone carriers, Straight Talk offers phone service with no contracts, but full features. &lt;/p&gt;      &lt;p&gt;	They offer two plans: the "All You Need" plan is 1000 minutes / 1000 texts / 30 MB data per month.  However, their unlimited plan is priced well - $45 for unlimited minutes, texts, and web.  Both plans come without a contract to lock you in, and  the plans do no contain any hidden charges, such as activation fees.&lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=13312&amp;amp;oid=4585212'&gt;hook, line and sinker&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	The phones available for this plan are fully loaded smart phones from major manufacturers like Kyocera, LG, Motorola, Samsung, and Nokia.  They contain mp3 players, GPS navigation, cameras, bluetooth, and internet browsing.&lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=13322&amp;amp;oid=4585212'&gt;call a friend&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	in our case, a no contract phone has worked out really well.  My wife uses a no contract plan with a smart phone, and she sees no difference in performance from when she had a contract plan - except that she saves a lot of money.  She does not have an unlimited plan, because we stay home a lot with the 6 month old, and we have a land line. &lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=13332&amp;amp;oid=4585212'&gt;everything you need&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	So, I think that deals like Straight Talk is offering can be really good for a cell phone.  This deal will really appeal to you if you are looking to reduce your monthly expenses, because it offers you a chance to cut expenses without reducing quality.&lt;/p&gt;      &lt;p&gt;	&amp;lt;iframe width="425" height="349" src="http://www.youtube.com/embed/h_EeaIFiDaw" frameborder="0" allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;      &lt;p&gt;  &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=4585212'&gt;    &lt;img style='border:none;' src='http://app.socialspark.com/views?oid=4585212' border='0' alt='Visit Sponsor&amp;apos;s Site'/&gt;  &lt;/a&gt;&lt;/p&gt;    &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-9068883977202698960?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/9068883977202698960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=9068883977202698960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/9068883977202698960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/9068883977202698960'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/08/how-to-save-on-cell-phone-plans.html' title='How to Save on Cell Phone Plans'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-9071881553460297917</id><published>2011-07-29T09:52:00.001-05:00</published><updated>2011-07-29T09:52:15.079-05:00</updated><title type='text'>Simplicity and Technology Applied to Cell Phones</title><content type='html'>    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;      &lt;p&gt;This is a Sponsored post written by me on behalf of &lt;a rel='nofollow' href='http://v2-qa.socialspark.com/disclosure_clicks?oid=4439712'&gt;Straight Talk&lt;/a&gt; for &lt;a rel='nofollow' href='http://qa.izea.in/rXJg'&gt;SocialSpark&lt;/a&gt;. All opinions are 100% mine.&lt;/p&gt;      &lt;p&gt;	Straight Talk is offering a really good deal for a cell phone.  This deal will really appeal to you if you are looking to reduce your monthly expenses, because it offers you a chance to cut expenses without reducing quality.&lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=13282&amp;amp;oid=4439712'&gt;Hook, line and sinker&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	For about 1/2 of what other cell phone carriers cost, Straight Talk offers phone service with no contracts, but full features. &lt;/p&gt;      &lt;p&gt;	They offer two plans: the "All You Need" plan is 1000 minutes / 1000 texts / 30 MB data per month.  However, their unlimited plan is priced well - $45 for unlimited minutes, texts, and web.  Both plans come without a contract to lock you in, and  the plans do no contain any hidden charges, such as activation fees.&lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=13292&amp;amp;oid=4439712'&gt;real Straight Talk customer&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	The phones available for this plan are fully loaded smart phones from major manufacturers like Kyocera, LG, Motorola, Samsung, and Nokia.  They contain mp3 players, GPS navigation, cameras, bluetooth, and internet browsing.&lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=13302&amp;amp;oid=4439712'&gt;everything you need&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	My wife uses a no contract plan with a smart phone, and she sees no difference in performance from when she had a contract plan - except that she saves a lot of money.  She does not have an unlimited plan, because we stay home a lot with the 6 month old, and we have a land line.  So, in our case, a no contract phone has worked out really well.&lt;/p&gt;      &lt;p&gt;	&amp;lt;iframe width="425" height="349" src="http://www.youtube.com/embed/RKPihLfELWo" frameborder="0" allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;      &lt;p&gt;  &lt;a rel='nofollow' href='http://v2-qa.socialspark.com/disclosure_clicks?oid=4439712'&gt;    &lt;img style='border:none;' src='http://v2-qa.socialspark.com/views?oid=4439712' border='0' alt='Visit Sponsor&amp;apos;s Site'/&gt;  &lt;/a&gt;&lt;/p&gt;    &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-9071881553460297917?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/9071881553460297917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=9071881553460297917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/9071881553460297917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/9071881553460297917'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/07/simplicity-and-technology-applied-to_29.html' title='Simplicity and Technology Applied to Cell Phones'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4075512942787203448</id><published>2011-07-28T19:01:00.001-05:00</published><updated>2011-07-28T19:01:11.384-05:00</updated><title type='text'>Simplicity and Technology Applied to Cell Phones</title><content type='html'>    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;      &lt;p&gt;This is a Sponsored post written by me on behalf of &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=4439712'&gt;Straight Talk&lt;/a&gt; for &lt;a rel='nofollow' href='http://izea.in/rXJg'&gt;SocialSpark&lt;/a&gt;. All opinions are 100% mine.&lt;/p&gt;      &lt;p&gt;	Straight Talk is offering a really good deal for a cell phone.  This deal will really appeal to you if you are looking to reduce your monthly expenses, because it offers you a chance to cut expenses without reducing quality.&lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=13282&amp;amp;oid=4439712'&gt;Hook, line and sinker&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	For about 1/2 of what other cell phone carriers cost, Straight Talk offers phone service with no contracts, but full features. &lt;/p&gt;      &lt;p&gt;	They offer two plans: the "All You Need" plan is 1000 minutes / 1000 texts / 30 MB data per month.  However, their unlimited plan is priced well - $45 for unlimited minutes, texts, and web.  Both plans come without a contract to lock you in, and  the plans do no contain any hidden charges, such as activation fees.&lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=13292&amp;amp;oid=4439712'&gt;real Straight Talk customer&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	The phones available for this plan are fully loaded smart phones from major manufacturers like Kyocera, LG, Motorola, Samsung, and Nokia.  They contain mp3 players, GPS navigation, cameras, bluetooth, and internet browsing.&lt;/p&gt;      &lt;p&gt;	&lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=13302&amp;amp;oid=4439712'&gt;everything you need&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;	My wife uses a no contract plan with a smart phone, and she sees no difference in performance from when she had a contract plan - except that she saves a lot of money.  She does not have an unlimited plan, because we stay home a lot with the 6 month old, and we have a land line.  So, in our case, a no contract phone has worked out really well.&lt;/p&gt;      &lt;p&gt;	&amp;lt;iframe width="425" height="349" src="http://www.youtube.com/embed/RKPihLfELWo" frameborder="0" allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;      &lt;p&gt;  &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=4439712'&gt;    &lt;img style='border:none;' src='http://app.socialspark.com/views?oid=4439712' border='0' alt='Visit Sponsor&amp;apos;s Site'/&gt;  &lt;/a&gt;&lt;/p&gt;    &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4075512942787203448?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4075512942787203448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4075512942787203448' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4075512942787203448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4075512942787203448'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/07/simplicity-and-technology-applied-to.html' title='Simplicity and Technology Applied to Cell Phones'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-543620489320074183</id><published>2011-07-07T17:01:00.001-05:00</published><updated>2011-07-07T17:01:23.358-05:00</updated><title type='text'>iPad Magazine App Takes Advantage of All Media Formats</title><content type='html'>    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;      &lt;p&gt;This is a Sponsored post written by me on behalf of &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=3681682'&gt;Ringier Media&lt;/a&gt; for &lt;a rel='nofollow' href='http://izea.in/rXJg'&gt;SocialSpark&lt;/a&gt;. All opinions are 100% mine.&lt;/p&gt;      &lt;p&gt;	There is a new iPad app called "the collection".  This app works like a monthly magazine.  Each month, the app will be populated by a new issue that is focused on one subject.&lt;/p&gt;      &lt;p&gt;	This subject is then covered by stories, photos, video, etc.&lt;/p&gt;      &lt;p&gt;	The first issue was devoted to Prince William and his wedding.  The second (and latest) issue is the "global baby" - it follows a couple having a baby through a surrogate.  Again, the issue will be more than a glossy magazine.  It is a multimedia presentation that entertains and informs through all possible channels on the iPad. &lt;/p&gt;      &lt;p&gt;	Just the thought of this app makes me excited - because I can see how it can blow over TV documentaries, ebooks, and videos.  Instead, it combines the best features of all of them, and can be the product of the future.  We are talking about "smart" magazines, newspapers, and video.&lt;/p&gt;      &lt;p&gt;	With the collection, I can see sitting down on a Sunday afternoon, firing up your iPad, and getting immersed in a subject - one minute you are reading an article, then you are watching a short video, then a musical piece, then photos, then an interactive chart or map - the possibilities are endless.&lt;/p&gt;      &lt;p&gt;	I encourage you to download   &lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=9932&amp;amp;oid=3681682'&gt;the collection&lt;/a&gt;  app and try it out.&lt;/p&gt;      &lt;p&gt;  &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=3681682'&gt;    &lt;img style='border:none;' src='http://app.socialspark.com/views?oid=3681682' border='0' alt='Visit Sponsor&amp;apos;s Site'/&gt;  &lt;/a&gt;&lt;/p&gt;    &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-543620489320074183?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/543620489320074183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=543620489320074183' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/543620489320074183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/543620489320074183'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/07/ipad-magazine-app-takes-advantage-of.html' title='iPad Magazine App Takes Advantage of All Media Formats'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5765682450122226397</id><published>2011-07-02T16:01:00.001-05:00</published><updated>2011-07-02T16:01:08.706-05:00</updated><title type='text'>New App Let's You Accept Credit Cards on the Go</title><content type='html'>    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;      &lt;p&gt;This is a Sponsored post written by me on behalf of &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=3927662'&gt;Payfirma&lt;/a&gt; for &lt;a rel='nofollow' href='http://izea.in/rXJg'&gt;SocialSpark&lt;/a&gt;. All opinions are 100% mine.&lt;/p&gt;      &lt;p&gt;	There is a clever new iPhone and iPad app by a company called Payfirma.  This is a virtual credit card terminal!  This is so useful and clever, that the product recently experienced wild, viral growth.&lt;/p&gt;      &lt;p&gt;	There is plenty of demand from people starting a small business for a way to accept credit cards.  In the not so distant "old days" it required a strong credit check, large bank account, and hefty fees to have a merchant account, and be able to accept credit cards.&lt;/p&gt;      &lt;p&gt;	Now, this system has instant approval, and only charges about 2% in fees, which is very reasonable.&lt;/p&gt;      &lt;p&gt;	To make the product even easier to use, Payfirma can send you a free card swiper.  This makes it quicker and safer to process credit cards.  No more typing in the numbers manually, and worrying about a mistake, or someone looking over your shoulder and memorizing the numbers.&lt;/p&gt;      &lt;p&gt;	These iPad and iPhone apps are revolutionizing small and micro businesses - allowing them to compete against the bigger companies.  Previously, a small company would look amateurish because it could not easily process a credit card.  Now, even a one man business can smoothly process credit cards - thus retaining the look and feeling about being a professional.&lt;/p&gt;      &lt;p&gt;  &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=3927662'&gt;    &lt;img style='border:none;' src='http://app.socialspark.com/views?oid=3927662' border='0' alt='Visit Sponsor&amp;apos;s Site'/&gt;  &lt;/a&gt;&lt;/p&gt;    &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5765682450122226397?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5765682450122226397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5765682450122226397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5765682450122226397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5765682450122226397'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/07/new-app-let-you-accept-credit-cards-on.html' title='New App Let&amp;#39;s You Accept Credit Cards on the Go'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-7382428593172044173</id><published>2011-07-01T18:01:00.001-05:00</published><updated>2011-07-01T18:01:35.979-05:00</updated><title type='text'>Keeping Your Old Electronics Out of Landfills</title><content type='html'>    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;      &lt;p&gt;This is a Sponsored post written by me on behalf of &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=3664682'&gt;Gazelle&lt;/a&gt; for &lt;a rel='nofollow' href='http://izea.in/rXJg'&gt;SocialSpark&lt;/a&gt;. All opinions are 100% mine.&lt;/p&gt;      &lt;p&gt;	Today, the numbers and types of computers and electronic gadgets are exploding.  Video recorders, cameras, iPads, computers, etc. have shorter lifecycles, and are rapidly replaced.  Any new electronic gadget begins to become obsolete as soon as you take it out of the packaging.&lt;/p&gt;      &lt;p&gt;	The downside of all this progress is the electronic waste that is generated.  Electronics are not bio-degradable.  In fact, they are dangerous because they contain mercury and other heavy metals.&lt;/p&gt;      &lt;p&gt;	The issue of what to do about used electronics has become more of a headache as the years go by, because more people keep upgrading.&lt;/p&gt;      &lt;p&gt;	However, there is now a solution:   &lt;a rel='nofollow' href='http://app.socialspark.com/clicks?lid=10232&amp;amp;oid=3664682'&gt;gazelle.com&lt;/a&gt;       This for profit company recycles electronic gadgets - selling the parts and sharing the money with the original owner.&lt;/p&gt;      &lt;p&gt;	I have several cell phones, a palm pilot, and a couple cmputers&lt;/p&gt;      &lt;p&gt;	Gazelle.com was invented in 2006 and have served 175,000 people.  During this time, they have learned a lot of tricks to help put the donor at rest.  For example, someone will manually go through any gadget you send.  They look to make sure any and all data has been erased.&lt;/p&gt;      &lt;p&gt;	Shipping your old gadget to gazelle.com is free, and they can even send you the box for it!&lt;/p&gt;      &lt;p&gt;	Finally, Gazelle can pay you by check, PayPal, o Amazon or Walmart gift cars.&lt;/p&gt;      &lt;p&gt;  &lt;a rel='nofollow' href='http://app.socialspark.com/disclosure_clicks?oid=3664682'&gt;    &lt;img style='border:none;' src='http://app.socialspark.com/views?oid=3664682' border='0' alt='Visit Sponsor&amp;apos;s Site'/&gt;  &lt;/a&gt;&lt;/p&gt;    &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-7382428593172044173?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/7382428593172044173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=7382428593172044173' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7382428593172044173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7382428593172044173'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/07/keeping-your-old-electronics-out-of.html' title='Keeping Your Old Electronics Out of Landfills'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6235334098586047823</id><published>2011-07-01T02:26:00.002-05:00</published><updated>2011-07-01T02:26:11.442-05:00</updated><title type='text'>Running Unix Commands from Awk</title><content type='html'>You can run a unix command through awk, and then access the command's output within the awk script.&lt;br /&gt;&lt;br /&gt;The trick is to use: "cmd"|getline  &lt;br /&gt;&lt;br /&gt;The first call to "cmd"|getline will open it as a pipe and fetch the first line of output.  Each subsequent call will fetch the next line of output.  If there is no output, it will return empty.&lt;br /&gt;&lt;br /&gt;For each line, $0 will be automatically assigned to the whole line, and the fields ($1, $2, etc) will be assigned by breaking up on the whitespace pattern.&lt;br /&gt;&lt;br /&gt;You can use this neatly in a while statement:&lt;br /&gt;&lt;br /&gt;while ("cmd"|getline)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is an example to print the environmental variable settings:&lt;br /&gt;&lt;br /&gt;#! /bin/nawk -f&lt;br /&gt;&lt;br /&gt;BEGIN {&lt;br /&gt;&lt;br /&gt;while ("env"|getline)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;print $0&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This will run the "env" command in a unix shell and it will keep looping until there are no more environment variables.  Each line will be printed by the print command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6235334098586047823?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6235334098586047823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6235334098586047823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6235334098586047823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6235334098586047823'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/07/running-unix-commands-from-awk.html' title='Running Unix Commands from Awk'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4531867191944992928</id><published>2011-07-01T02:23:00.002-05:00</published><updated>2011-07-01T02:23:10.595-05:00</updated><title type='text'>An Example of Awk to Python</title><content type='html'>&lt;div&gt;Python is a scripting language that is gaining popularity.&amp;nbsp; A lot of people think it is better than perl, which I think has a lot of ugly complexity to it.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;I have python installed on my unix system, and I translated the awk squares program into python.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Below I first present the original awk version, and then the python version.&amp;nbsp; They both print the numbers 1 - 10, along with their squares.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;awk version&lt;/div&gt;&lt;div&gt;-------------------------&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;#! /usr/bin/nawk -f&lt;/div&gt;&lt;div&gt;BEGIN {&lt;/div&gt;&lt;div&gt;printf ("\nSquares from 1 to 10")&lt;/div&gt;&lt;div&gt;printf ("\nNumber\tSquare\n")&lt;/div&gt;&lt;div&gt;printf ("------\t------\n")&lt;/div&gt;&lt;div&gt;for (i=1; i&amp;lt;=10; i++)&lt;/div&gt;&lt;div&gt;printf ("%d\t%d\n", i, i^2)&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;python version&lt;/div&gt;&lt;div&gt;------------------------&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;#! /usr/local/bin/python&lt;/div&gt;&lt;div&gt;print  "\nSquares from 1 to 10"&lt;/div&gt;&lt;div&gt;print "Number\tSquare"&lt;/div&gt;&lt;div&gt;print "------\t------"&lt;/div&gt;&lt;div&gt;for i in range(1,11):&lt;/div&gt;&lt;div&gt;print str(i) + "\t" + str(i**2)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The #! on the first line tells unix the location of the script interpreter to use. The python range command returns a range of integers, can can be used with the for loop.&amp;nbsp; Also note that the python print statement only prints strings, so we have to convert the numbers to strings.&amp;nbsp; Notice that python uses ** instead of ^ for raising a number to a power.&lt;/div&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4531867191944992928?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4531867191944992928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4531867191944992928' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4531867191944992928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4531867191944992928'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/07/example-of-awk-to-python.html' title='An Example of Awk to Python'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-522423366708120994</id><published>2011-07-01T00:42:00.002-05:00</published><updated>2011-07-01T00:42:37.150-05:00</updated><title type='text'>Choosing a Host for your Website</title><content type='html'>WebHostingGeeks.com is a resource that you can use to evaluate different &lt;a href="http://webhostinggeeks.com"&gt;web hosting&lt;/a&gt; companies.  They record the votes of volunteers who rank and review People rank and review their webhosts.&lt;br /&gt;&lt;br /&gt;This site is user friendly for navigation, and ranks hosting companies several times, by how they rank on various lists. &lt;br /&gt;&lt;br /&gt;For example, they have an overall top 10 webhosts, but they also have categories like the best hosts with &lt;a href="http://webhostinggeeks.com/multipledomainhosting.html"&gt;multiple domain hosting&lt;/a&gt;, &lt;a href="http://webhostinggeeks.com/dedicatedserverhosting.html"&gt;dedicated server hosting&lt;/a&gt;, etc.&lt;br /&gt;&lt;br /&gt;One category I found interesting was the best &lt;a href="http://webhostinggeeks.com/greenwebhosting.html"&gt;green web hosts&lt;/a&gt;, where they look at data centers that buy power from renewable sources, recycle waste, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-522423366708120994?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/522423366708120994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=522423366708120994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/522423366708120994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/522423366708120994'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/07/choosing-host-for-your-website.html' title='Choosing a Host for your Website'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5191865724654670467</id><published>2011-06-14T00:56:00.000-05:00</published><updated>2011-06-14T00:56:39.910-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Awk Scripting'/><title type='text'>Calling Unix Commands From Within Awk: system vs getline</title><content type='html'>Inside an awk script, there are two ways in which you can interface with the operating system: system() and getline.&lt;br /&gt;&lt;br /&gt;system() is good if you want to just run a command, and don't need any results back.&lt;br /&gt;&lt;br /&gt;getline can be used when you want your awk program to return data back into the awk script.&lt;br /&gt;&lt;br /&gt;Some examples:&lt;br /&gt;&lt;br /&gt;ret_code = system("sort file1 &gt; file2")&lt;br /&gt;&lt;br /&gt;while("grep true file"|getline x)&lt;br /&gt;&lt;br /&gt;The first example sorts a file, and then stores the return code in the ret_code.&lt;br /&gt;&lt;br /&gt;The second example is running a grep command in unix.  It is running the command through getline.  Here, the getline statement is inside a while loop.  The loop will keep looping until there is no more data from the grep.  Each call to the while loop results in x holding the latest data from the grep command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5191865724654670467?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5191865724654670467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5191865724654670467' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5191865724654670467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5191865724654670467'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/06/calling-unix-commands-from-within-awk.html' title='Calling Unix Commands From Within Awk: system vs getline'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-1973869836114243085</id><published>2011-06-12T01:36:00.002-05:00</published><updated>2011-06-12T01:36:46.350-05:00</updated><title type='text'>An Advertising Agency For the Internet Age</title><content type='html'>I was just reading a website of an &lt;a href="http://www.ThatAdvertisingAgency.com"&gt;Advertising Agency&lt;/a&gt; that seems to understand that the internet is changing the media world.&lt;br /&gt;&lt;br /&gt;Their website itself shows that they understand the internet.  Their website isn't flashy, with whiz bang effects that take time to load.  Instead, there website is simple, and to the point.&lt;br /&gt;&lt;br /&gt;They make a good point about the importance of an agency created in the digital age.  In the old days, there were only a few TV channels.  TV, radio, and newspapers did not have to compete with internet surfing, podcasts, or interactive online games.  People had longer attention spans.  You could advertise in the mass media and reach a lot of people.  &lt;br /&gt;&lt;br /&gt;Today, there are plenty of specialized cable channels, and plenty of online alternatives.  Audiences are fragmented.  Now, instead of trying to reach a lot of people with a mainstream commercial, the best way to reach people is to create targeted commercials and run them in these different niche media outlets.&lt;br /&gt;&lt;br /&gt;Digital media is now interactive, and gives advertisers the tools to track the effectiveness of campaigns.&lt;br /&gt;&lt;br /&gt;In this new environment, if you use a standard &lt;a href="http://www.ThatAdvertisingAgency.com"&gt;Advertising Agency&lt;/a&gt; that uses the old techniques, your advertising won't be as effective as it could be.  For example, you would not want your agency to create bland, generic advertisements that are not targeted to anyone in particular, and then try to run them on different channels.&lt;br /&gt;&lt;br /&gt;Instead, this &lt;a href="http://www.ThatAdvertisingAgency.com"&gt;ad agency&lt;/a&gt; would probably create an ad that appeals, for example, to fans of cooking shows and run that on the cooking channels.  They could create another commercial for home and garden channels, etc.&lt;br /&gt;&lt;br /&gt;This particular agency would also use online tools to track traffic and conversions for online advertising.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-1973869836114243085?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/1973869836114243085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=1973869836114243085' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1973869836114243085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1973869836114243085'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/06/advertising-agency-for-internet-age.html' title='An Advertising Agency For the Internet Age'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8079415385560092057</id><published>2011-06-12T01:35:00.002-05:00</published><updated>2011-06-12T01:35:01.971-05:00</updated><title type='text'>How To Split Large Files in Unix</title><content type='html'>Let's say that we have a large unix file.  For example, a text file called &lt;span style="font-style:italic;"&gt;my_list&lt;/span&gt; with 100,000 lines.&lt;br /&gt;&lt;br /&gt;We need the data contained in smaller files with no more than 1000 lines each.&lt;br /&gt;&lt;br /&gt;We can use the unix &lt;span style="font-style:italic;"&gt;split&lt;/span&gt; command:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;split -1000 my_list&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will create 100 files in the current directory that each contain 1000 lines from my_list.  Since we did not specify a name for the output file, the files will be named by an &lt;span style="font-style:italic;"&gt;x&lt;/span&gt;, followed by two letters of the alphabet (from &lt;span style="font-style:italic;"&gt;aa&lt;/span&gt; to &lt;span style="font-style:italic;"&gt;zz&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;So, for example, the first 1000 lines of &lt;span style="font-style:italic;"&gt;my_list&lt;/span&gt; will be in file &lt;span style="font-style:italic;"&gt;xaa&lt;/span&gt;, the next 1000 lines in &lt;span style="font-style:italic;"&gt;xab&lt;/span&gt;, the next 1000 in &lt;span style="font-style:italic;"&gt;xac&lt;/span&gt;, etc.&lt;br /&gt;&lt;br /&gt;If we had specified an output file name like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;split -1000 my_list my_list&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then the output files would have been &lt;span style="font-style:italic;"&gt;my_listaa&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;mylistab&lt;/span&gt;, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8079415385560092057?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8079415385560092057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8079415385560092057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8079415385560092057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8079415385560092057'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/06/how-to-split-large-files-in-unix.html' title='How To Split Large Files in Unix'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2642841215821019726</id><published>2011-06-12T01:31:00.002-05:00</published><updated>2011-06-12T01:31:35.965-05:00</updated><title type='text'>Understanding Regular Expression in Awk</title><content type='html'>&lt;div&gt;In Awk scripts, you can use regular expressions to match text.&amp;nbsp; Regular expressions are encolsed in forward slashes (/).&amp;nbsp; &lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;In the pattern part of an awk script, the regular expression by iteself means that the pattern is checked against the whole record ($0).&amp;nbsp; &lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;For example,&amp;nbsp; &lt;font color=#007f40&gt;/jump/ {print $1}&lt;/FONT&gt; will print the first field if the line contains &lt;font color=#7f003f&gt;jump&lt;/FONT&gt;.&amp;nbsp; &lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Regular expressions can be matched to strings by using the tilde (~).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;For example, &lt;font color=#007f40&gt;$0 ~ /jump/ {print $1}&lt;/FONT&gt; is equivalent to the statement above, while&lt;/div&gt;&lt;div&gt;&lt;font color=#007f40&gt;$2 ~ /jump/ {print $1}&lt;/FONT&gt; will only print the first field if the second field contains the pattern.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Brackets allow alternatives in regular expressions.&amp;nbsp; For  example, &lt;font color=#007f40&gt;/[Jj]ump/ {print $1}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;will print the first field if the line contains &lt;font color=#7f003f&gt;jump&lt;/FONT&gt; or &lt;font color=#7f003f&gt;Jump&lt;/FONT&gt;.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;A ^ anchors the pattern to the start of the string.&amp;nbsp; So &lt;font color=#007f40&gt;/^jump/ {print $1}&lt;/FONT&gt; will only print the first field if the line starts with &lt;font color=#7f003f&gt;jump&lt;/FONT&gt;.&amp;nbsp; It will not, for example, match &lt;font color=#7f003f&gt;parachute jump&lt;/FONT&gt;.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;A $ anchors the pattern to the end of the string. So &lt;font color=#007f40&gt;/jump$/ {print $1}&lt;/FONT&gt; will print the first field if the line is &lt;font color=#7f003f&gt;jump&lt;/FONT&gt; or &lt;font color=#7f003f&gt;parachute jump&lt;/FONT&gt;, but not &lt;font color=#7f003f&gt;jump out&lt;/FONT&gt;.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;A * after a character or brackets means "0 or more", while a + means "1 or more".&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;So, &lt;font color=#007f40&gt;/j*/&lt;/FONT&gt; would match &lt;font  color=#bf00bf&gt;jump&lt;/FONT&gt;, &lt;font color=#bf00bf&gt;banjo&lt;/FONT&gt;, and &lt;font color=#bf00bf&gt;cook&lt;/FONT&gt;, but &lt;font color=#007f40&gt;/j+/&lt;/FONT&gt; would match &lt;font color=#bf00bf&gt;jump&lt;/FONT&gt; and &lt;font color=#bf00bf&gt;banjo&lt;/FONT&gt;, but not &lt;font color=#bf00bf&gt;cook&lt;/FONT&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2642841215821019726?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2642841215821019726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2642841215821019726' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2642841215821019726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2642841215821019726'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/06/understanding-regular-expression-in-awk.html' title='Understanding Regular Expression in Awk'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8882612675210639404</id><published>2011-06-04T00:42:00.000-05:00</published><updated>2011-06-04T00:42:14.735-05:00</updated><title type='text'>Should You Buy Gold?</title><content type='html'>Is this a good time to buy &lt;a href="http://www.goldcoinsgain.com/gold-bullion-coins.html"&gt;gold bullion&lt;/a&gt;?  A lot of people are investing in &lt;a href="http://www.goldcoinsgain.com/gold-bullion-coins.html"&gt;bullion&lt;/a&gt; because gold prices are at record highs.  &lt;br /&gt;&lt;br /&gt;People are worried that high rates of inflation will occur because our government is printing a lot of dollars and holding interest rates low to help the economy recover from the recession.  The dollar is at a low point, and commodities / metals have recently soared in price.&lt;br /&gt;&lt;br /&gt;So, it might not be a bad idea for individuals to diversify and invest some of their money in gold.  But, many people are not sure how to &lt;a href="http://www.goldcoinsgain.com/gold-bullion-coins.html"&gt;buy bullion&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Fortunately, contrary to many people's ideas, it can be as easy to &lt;a href="http://www.goldcoinsgain.com/gold-bullion-coins.html"&gt;buy gold bullion&lt;/a&gt; as buying stocks and bonds. One way to buy, is through a dealer such as GoldCoinsGain.com.  They can even tell you about having a &lt;a href="http://www.goldcoinsgain.com/gold-ira-and-gold-401k-accounts.html"&gt;gold IRA&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8882612675210639404?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8882612675210639404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8882612675210639404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8882612675210639404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8882612675210639404'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/06/should-you-buy-gold.html' title='Should You Buy Gold?'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5643802649020921613</id><published>2011-06-04T00:35:00.001-05:00</published><updated>2011-06-04T00:35:20.833-05:00</updated><title type='text'>sed (unix stream editor)</title><content type='html'>The Unix stream editor (&lt;span style="font-style: italic;"&gt;sed&lt;/span&gt;) is useful for editing streams of text.&amp;nbsp; You can either&amp;nbsp; pipe the text into &lt;span style="font-style: italic;"&gt;sed&lt;/span&gt;, or else give a file name - in which case, &lt;span style="font-style: italic;"&gt;sed&lt;/span&gt; works on the file.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;In all cases, &lt;span style="font-style: italic;"&gt;sed&lt;/span&gt; does not change the original text, but sends the modified text to standard out.&lt;br /&gt;&lt;br /&gt;Sure, I could just use &lt;span style="font-style: italic;"&gt;awk&lt;/span&gt; but, for some tasks, its just easier to use &lt;span style="font-style: italic;"&gt;sed&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Some examples:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;sed 4q&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Prints the first 4 lines of the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;sed 's/yes/no/'&amp;nbsp;&lt;/span&gt;&amp;nbsp; Substitute "no" for the first occurance of "yes" on each line.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(192, 0, 0);"&gt;sed 's/yes/no/g'&amp;nbsp;&lt;/span&gt; In this  case, substitute "no" for all occurances of "yes".&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;sed 's/yes/no/2' &lt;/span&gt;&amp;nbsp; Substitute "no" for the second occurance of "yes" on each line.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5643802649020921613?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5643802649020921613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5643802649020921613' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5643802649020921613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5643802649020921613'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/06/sed-unix-stream-editor.html' title='sed (unix stream editor)'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-3370934017275008055</id><published>2011-06-04T00:34:00.001-05:00</published><updated>2011-06-04T00:34:24.223-05:00</updated><title type='text'>The Unix For Loop</title><content type='html'>If you are working in a unix (or linux) environment, you might find the command line 'for' loop to be handy for automating different tasks.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Below are three examples of the 'for' loop.  All the commands are in italics and should be entered on the command line, followed by a carriage return.  &lt;br /&gt;Note that, after entering the initial 'for' line, you will get the secondary unix prompt, which is usually a "&gt;".&lt;br /&gt;&lt;br /&gt;1. Rename all ".old" files in the current directory to ".bak":&lt;br /&gt;&lt;pre&gt;&lt;i&gt; for i in *.old &lt;/i&gt;  &lt;br /&gt;&lt;i&gt; do &lt;/i&gt; &lt;br /&gt;&lt;i&gt; j=`echo $i|sed 's/old/bak/'` &lt;/i&gt; &lt;br /&gt;&lt;i&gt; mv $i $j &lt;/i&gt; &lt;br /&gt;&lt;i&gt; done &lt;/i&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here, we looped thru all files with extension ".old", setting the variable "i" to be the file name we are currently looping thru.  Then, between the "do" and "done", we have the body of the loop.  On each pass, we echo the file name ("i") to the unix stream editor sed.  Sed replaces the "old" with "bak" (so file "a.old" becomes "a.bak"), and saves the changed name to variable "j".  Then, we use the unix move (mv) command to rename the original file (ex. a.old) to the new file (a.bak).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Change all instances of "yes" to "no" in all ".txt" files in the current directory.  &lt;br /&gt;Back up the original files to ".bak".&lt;br /&gt;&lt;pre&gt;&lt;i&gt; for i in *.txt&lt;/i&gt;  &lt;br /&gt;&lt;i&gt; do &lt;/i&gt; &lt;br /&gt;&lt;i&gt; j=`echo $i|sed 's/txt/bak/'` &lt;/i&gt; &lt;br /&gt;&lt;i&gt; mv $i $j &lt;/i&gt; &lt;br /&gt;&lt;i&gt;  sed 's/yes/no/' $j &gt; $i &lt;/i&gt;&lt;br /&gt;&lt;i&gt; done &lt;/i&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In this case, we rename each file from ".txt" to ".bak".  Additionally, we use sed a second time, on the &lt;b&gt;contents&lt;/b&gt; of the original file (now with a ".bak" extension) and save the modified text back to the original name (with ".txt").&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3.  Loop thru a text file containing possible file names.  &lt;br /&gt;If the file is readable, print the first line, otherwise print an error message:&lt;br /&gt;&lt;pre&gt;&lt;i&gt; for i in `cat file_list.txt`&lt;/i&gt;&lt;br /&gt;&lt;i&gt; do &lt;/i&gt;&lt;br /&gt;&lt;i&gt;      if test -r $i &lt;/i&gt;&lt;br /&gt;&lt;i&gt;     then &lt;/i&gt;&lt;br /&gt;&lt;i&gt;           echo "Here is the first line of file: $i"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;           sed 1q $i&lt;/i&gt;&lt;br /&gt;&lt;i&gt;     else &lt;/i&gt;&lt;br /&gt;&lt;i&gt;         echo "file $i cannot be open for reading." &lt;/i&gt;&lt;br /&gt;&lt;i&gt;     fi&lt;/i&gt;&lt;br /&gt;&lt;i&gt;  done &lt;/i&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here, we loop thru the results of a command (in this case "cat"), rather than looping thru files in the directory.  We also use an if statement with the "test" command to test for a condition (in this case, whether the file is readable).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-3370934017275008055?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/3370934017275008055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=3370934017275008055' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3370934017275008055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3370934017275008055'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/06/unix-for-loop.html' title='The Unix For Loop'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4012643921357283644</id><published>2011-05-29T01:48:00.000-05:00</published><updated>2011-05-29T01:48:02.877-05:00</updated><title type='text'>An Ad Agency That Understands How The Internet is Changing Things</title><content type='html'>The internet is changing the profession of advertising.  The agencies who can adapt to these changes will be the ones that succeed in the near future.&lt;br /&gt;&lt;br /&gt;I recently visited the website of an &lt;a href="http://www.ThatAdvertisingAgency.com"&gt;Advertising Agency&lt;/a&gt; that "gets it".&lt;br /&gt;&lt;br /&gt;I was impressed as soon as my browser started to load the site.  The old ways of print and TV ads are all about aesthetics, glitz, and glamor.  Their website instead reflected the online qualities of being simple and quick loading.  They avoided fancy, slow-loading flash graphics.  They seemed to know that online visitors who have to wait will click away impatiently.&lt;br /&gt;&lt;br /&gt;On their site, they make a good case for using an agency created specifically in the digital age.  In the old days, there were only a few TV channels.  TV, radio, and newspapers did not have to compete with internet surfing, podcasts, or interactive online games.  People had longer attention spans.  You could advertise in the mass media and reach a lot of people.  &lt;br /&gt;&lt;br /&gt;Today, there are plenty of specialized cable channels, and plenty of online alternatives.  Audiences are fragmented.  Now, instead of trying to reach a lot of people with a mainstream commercial, the best way to reach people is to create targeted commercials and run them in these different niche media outlets.&lt;br /&gt;&lt;br /&gt;Digital media is now interactive, and gives advertisers the tools to track the effectiveness of campaigns.&lt;br /&gt;&lt;br /&gt;In this new environment, if you use a standard &lt;a href="http://www.ThatAdvertisingAgency.com"&gt;Advertising Agency&lt;/a&gt; that uses the old techniques, your advertising won't be as effective as it could be.  For example, you would not want your agency to create bland, generic advertisements that are not targeted to anyone in particular, and then try to run them on different channels.&lt;br /&gt;&lt;br /&gt;Instead, this &lt;a href="http://www.ThatAdvertisingAgency.com"&gt;Advertising Agency&lt;/a&gt; would probably create an ad that appeals, for example, to fans of home shows and run that on home and garden channels.  They could create another commercial for cooking channels, etc.&lt;br /&gt;&lt;br /&gt;This particular agency would also use online tools to track traffic and conversions for online advertising.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4012643921357283644?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4012643921357283644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4012643921357283644' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4012643921357283644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4012643921357283644'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/ad-agency-that-understands-how-internet.html' title='An Ad Agency That Understands How The Internet is Changing Things'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5565614147247332903</id><published>2011-05-29T01:45:00.002-05:00</published><updated>2011-05-29T01:45:16.513-05:00</updated><title type='text'>Awk OFS Parameter</title><content type='html'>&lt;div&gt;In awk, OFS is the output field separator.&amp;nbsp; By default it is a space.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;This parameter is used by the print command when you separate strings by using a comma.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;For example, if we have a test file consisting of one line: &lt;font size=2&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#0000bf&gt;burp boy orange&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#00bf60&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Then running the following script on the file:&lt;font size=2&gt;&lt;font color=#407f00&gt;&lt;font color=#000000&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;nawk '&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;{&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;print $1,$2,$3&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;OFS="%"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;print $1,$2,$3&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;print $0&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;}' $*&lt;/FONT&gt;&lt;/div&gt;&lt;/FONT&gt;  &lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Will produce the following output:&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#007f40&gt;burp  boy orange&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#007f40&gt;burp%boy%orange&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#007f40&gt;burp boy orange&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Notice that, in the first print, OFS is the space by default. So the fields are printed with a space in between them.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Then, we set OFS to be a % sign, and the next print statement outputs the fields separated by a %.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Finally, we do a print on $0 to illustrate the fact that $0 always preserves the original format of the line.&lt;/div&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5565614147247332903?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5565614147247332903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5565614147247332903' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5565614147247332903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5565614147247332903'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/awk-ofs-parameter.html' title='Awk OFS Parameter'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5286431151293662528</id><published>2011-05-29T01:43:00.001-05:00</published><updated>2011-05-29T01:43:57.800-05:00</updated><title type='text'>Adventure Game Written In Awk</title><content type='html'>&lt;div&gt;I wrote a small text-adventure game in awk - just to stretch the perception of awk, and show that it can be used as a programming language.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;This game is small, but gives a taste of the fantasy adventure games of the 80's - like Zork from Infocom.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;In this adventure, you are in a cave complex, and need to find the hidden gold to win.&amp;nbsp; The adventure lets you move around, search, pick up objects, and use them.&amp;nbsp; It uses a menu - not free-form entries.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Here is the awk code:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#c00000&gt;nawk '&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;function intro() {&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "You are a brave adventurer. You have entered a hidden"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "cave just outside town, that is rumored  to hold gold!"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "To win this adventure, you need to get the gold."&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;function invent() {&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (coin || axe || sword)&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "You are carrying: "&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (coin) print "coin"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (axe) print "big, rusty battle axe"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (sword) print "small sword"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#c00000&gt;function cave() {&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "You are standing in a cave. Sunlight gleams behind you"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "from the entrance. In front of you, is  a wooden door."&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "You see an opening to the left, and one to the right."&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;invent()&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "What do you want to do? "&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "(o)pen wooden door"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "go (l)eft"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "go (r)ight"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "leave thru the (e)ntrance"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (sword) print "break door with your (s)word"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (axe) print "break door with your (a)xe"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "(y)ell Open Sesame"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "e(x)amine area"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "read  (i)ntroduction"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;"read x;echo $x"|getline x&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;close "read x;echo $x"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="o") {print "The wooden door is shut tight."; cave()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="l") {deadend()}&lt;/FONT&gt;&lt;font size=2&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="r") {cave2()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="e") {print "You decide to quit. Goodbye!";exit}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (sword&amp;amp;&amp;amp;x=="s") {print "your sword breaks!";sword=0;cave()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (axe&amp;amp;&amp;amp;x=="a") {&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "You chop down the door and find the gold!!"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "Great job, bold adventurer!"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "This is the end of this adventure, but"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "you have a promising career ahead of  you!"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;exit;&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="y") {&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "A band of evil goblins passing by the entrance"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "hear you, enter the cave, and kill you"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;exit;&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="x") {print "You find nothing";cave()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="i") {intro();cave()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "What do you want to do?";cave()&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#c00000&gt;function deadend() {&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "You are in a dead end"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font  color=#c00000&gt;invent()&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "What do you want to do? "&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "go (b)ack"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "e(x)amine area"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "read (i)ntroduction"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;"read x;echo $x"|getline x&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;close "read x;echo $x"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="b") {cave()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="x") {print "You find a sword!";sword=1;deadend()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="i") {intro();deadend()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "What do you want to do?";deadend()&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#c00000&gt;function cave2() {&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "You are in another cave."&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "You can go back, or explore a niche to the left."&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;invent()&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "What do you want to do? "&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "go (b)ack"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "enter (n)iche"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (rubble) print "(s)earch rubble"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "e(x)amine area"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "read (i)ntroduction"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;"read x;echo $x"|getline x&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;close "read x;echo $x"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="b") {cave()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="n") {niche()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (rubble&amp;amp;&amp;amp;x=="s"&amp;amp;&amp;amp;!coin) {print "you found a coin!";coin=1;cave2&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;()}&lt;/FONT&gt;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#c00000&gt;if (rubble&amp;amp;&amp;amp;x=="s"&amp;amp;&amp;amp;coin) {print "you found a nothing!";cave2()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="x") {print "You see a pile of rubble";rubble=1;cave2()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="i") {intro();cave2()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "What do you want to do?";cave2()&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#c00000&gt;function niche() {&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "You are in a niche."&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "There is a dwarf here!"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font  color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;invent()&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "What do you want to do? "&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "go (b)ack"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "(t)alk to dwarf"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (!sword&amp;amp;&amp;amp;!axe) print "(f)ight dwarf"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (sword) print "fight dwarf with (s)word"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (axe) print "fight dwarf with (a)xe"&lt;/FONT&gt;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#c00000&gt;if (coin) print "(o)ffer coin to dwarf"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "e(x)amine area"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "read (i)ntroduction"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;"read x;echo $x"|getline x&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;close "read x;echo $x"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font  color=#c00000&gt;if (x=="b") {cave2()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="t") {print "The dwarf grunts";niche()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="f") {print "The dwarf kills you";exit}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="s") {print "The dwarf kills you";exit}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="a") {print "The dwarf kills you";exit}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (coin&amp;amp;&amp;amp;x=="o") {print "The dwarf takes the coin and gives you a&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;n axe!";coin=0;axe=1;niche()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="x") {print "You find nothing";niche()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;if (x=="i") {intro();niche()}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;print "What do you want to do?";niche()&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;BEGIN { intro(); cave() }&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font  color=#c00000&gt;'&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;This is one of the longest awk programs that I have written.&amp;nbsp; Notice that it is function-driven.&amp;nbsp; I have created functions to give the introduction, and the inventory, and I have created functions for each room.&amp;nbsp; &lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The awk program is kicked off by the BEGIN section, which runs intro() and cave() to put you in the first room.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Each object is represented by a variable of the same name (i.e. sword for sword) and is either 0 (off) or 1 (on), depending if you have the object.&amp;nbsp; &lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Each function will print descriptions and gve options, depending on the setting of these boolean variables.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The inputting is done by using getline to run &lt;font color=#c00000&gt;"read x;echo $x" &lt;/FONT&gt;&lt;font color=#000000&gt;to read from the screen and echo the response into awk.&amp;nbsp; Then, a close is done so that the  next getline will get fresh input.&lt;/FONT&gt;&lt;/div&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5286431151293662528?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5286431151293662528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5286431151293662528' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5286431151293662528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5286431151293662528'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/adventure-game-written-in-awk.html' title='Adventure Game Written In Awk'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-1158759888937095097</id><published>2011-05-29T00:25:00.000-05:00</published><updated>2011-05-29T00:25:01.152-05:00</updated><title type='text'>How To Compare Webhosting Solutions</title><content type='html'>Your business depends on the reliability of your website.  Even with bricks-and-mortar store(s), many people use your website to decide if they will do business with you.&lt;br /&gt;&lt;br /&gt;For this reason, it's important that your site is hosted with the appropriate level of resources, and that downtime is minimized.&lt;br /&gt;&lt;br /&gt;One way to make sure that you are on a good host is by comparing them with other &lt;a href="http://webhostingrating.com"&gt;web hosting&lt;/a&gt; companies at a site such as WebHostingRating.com.&lt;br /&gt;&lt;br /&gt;This site is very useful for finding the right host for your needs because, in stead of just having one overall ranking, WebHostingRating.com rate websites on separate lists for different criteria.  In this way, you can see how a website did specifically in an area that is needed for your website.&lt;br /&gt;&lt;br /&gt;For example, they have categories such as best &lt;a href="http://webhostingrating.com/reseller-hosting"&gt;reseller hosting&lt;/a&gt; plans or best &lt;a href="http://webhostingrating.com/linux-hosting"&gt;linux hosting&lt;/a&gt;, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-1158759888937095097?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/1158759888937095097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=1158759888937095097' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1158759888937095097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1158759888937095097'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/how-to-compare-webhosting-solutions.html' title='How To Compare Webhosting Solutions'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2088896031727385631</id><published>2011-05-29T00:22:00.000-05:00</published><updated>2011-05-29T00:22:18.375-05:00</updated><title type='text'>Awk Script That Prints Each Filename in A Directory Backwards</title><content type='html'>&lt;div&gt;list_reverse is an awk program that uses the unix "ls" command to list the files in the current directory, and then prints the file names backwards.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;For example,&amp;nbsp; if the directory contains the files:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#407f00&gt;prog1.c&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#407f00&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#407f00&gt;sample.txt&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#407f00&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;list_reverse will display:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#407f00&gt;prog1.c --&amp;gt; c.1gorp&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#407f00&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#407f00&gt;sample.txt --&amp;gt; txt.elpmas&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Here is the script:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#800000&gt;nawk '&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;function reverse(a)&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font  color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;{&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;b=""&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;for(i=length(a);i&amp;gt;=1;i--)&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;b = b""substr(a,i,1)&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;return b&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;BEGIN {&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;while ( "ls"|getline)&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;print $0" --&amp;gt; "reverse($0)&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font  color=#800000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#800000&gt;' $*&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The first thing to realize about this script is that, technically, it is a unix shell script that runs a nawk script, rather than a pure nawk script.&amp;nbsp; &lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;We do not use "!# /usr/bin/nawk" to tell unix to execute the whole program as a nawk script.&amp;nbsp; Instead, it is a shell script, and we use &lt;em&gt;nawk 'program' $*&lt;/EM&gt;&amp;nbsp;&amp;nbsp; to run the nawk program and pass it the command line.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;We already know about awk BEGIN, body, and END sections.&amp;nbsp; Now, we introduce awk functions.&amp;nbsp; &lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;In this case, we have a function &lt;em&gt;reverse&lt;/EM&gt; that takes an argument &lt;em&gt;a, &lt;/EM&gt;puts its reverse into &lt;em&gt;b&lt;/EM&gt;, and returns the value of &lt;em&gt;b&lt;/EM&gt;.&amp;nbsp;&amp;nbsp; Since the &lt;em&gt;a&lt;/EM&gt; is a place-holder for whatever is passed into the  function, &lt;em&gt;a&lt;/EM&gt; is a local variable and is only defined in the function.&amp;nbsp; Any other variables, however, are global.&amp;nbsp; Thus, the function could directly manipulate $1, for example, and the variable &lt;em&gt;b&lt;/EM&gt; could be referenced in other parts of the awk script.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;This, in fact, is why the first part of the function sets &lt;em&gt;b&lt;/EM&gt; to empty - because it will have the value from the last time the function was invoked.&amp;nbsp; So, in other words, variables that are referenced in a function are created the first time the function is invoked, and then have global scope for the life of the program.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The function then loops thru the length of the string&lt;em&gt; a&lt;/EM&gt;, and uses the substr function to build a reversed copy of the string in &lt;em&gt;b&lt;/EM&gt;.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The BEGIN part of the program uses "ls|getline" to get the list of files in the current directory, loops thru the file names, and  prints the file name followed by its reverse (by calling the reverse function).&lt;/div&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2088896031727385631?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2088896031727385631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2088896031727385631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2088896031727385631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2088896031727385631'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/awk-script-that-prints-each-filename-in.html' title='Awk Script That Prints Each Filename in A Directory Backwards'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6742075647779047106</id><published>2011-05-26T23:30:00.001-05:00</published><updated>2011-05-26T23:30:16.760-05:00</updated><title type='text'>Dog Blown Away By Tornado Makes It Back Home</title><content type='html'>&lt;table cellspacing="0" cellpadding="0" border="0" &gt;&lt;tr&gt;&lt;td valign="top" style="font: inherit;"&gt;&lt;blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"&gt;&lt;div id="yiv1941372453"&gt;       &lt;style&gt; &lt;!-- #yiv1941372453   #yiv1941372453 p.yiv1941372453MsoNormal, #yiv1941372453 li.yiv1941372453MsoNormal, #yiv1941372453 div.yiv1941372453MsoNormal 	{margin:0in;margin-bottom:.0001pt;font-size:10.0pt;font-family:Arial;} #yiv1941372453 a:link, #yiv1941372453 span.yiv1941372453MsoHyperlink 	{color:blue;text-decoration:underline;} #yiv1941372453 a:visited, #yiv1941372453 span.yiv1941372453MsoHyperlinkFollowed 	{color:#606420;text-decoration:underline;} #yiv1941372453 span.yiv1941372453EmailStyle17 	{font-family:Arial;color:windowtext;}  _filtered #yiv1941372453 {margin:1.0in 1.25in 1.0in 1.25in;} #yiv1941372453 div.yiv1941372453Section1 	{} --&gt; &lt;/style&gt;  &lt;div class="yiv1941372453Section1"&gt;  &lt;p class="yiv1941372453MsoNormal"&gt;&lt;font size="2" face="Arial"&gt;&lt;span style="font-size: 10pt;"&gt;They found the dog on the front porch after 2 ½ weeks – he crawled back on 2 broken legs:&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;p class="yiv1941372453MsoNormal"&gt;&lt;font size="2" face="Arial"&gt;&lt;span style="font-size: 10pt;"&gt; &amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;p class="yiv1941372453MsoNormal"&gt;&lt;font size="2" face="Arial"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;a rel="nofollow" target="_blank" href="http://news.yahoo.com/s/yblog_thelookout/20110526/us_yblog_thelookout/dog-with-two-broken-legs-finds-owner-after-storm"&gt;http://news.yahoo.com/s/yblog_thelookout/20110526/us_yblog_thelookout/dog-with-two-broken-legs-finds-owner-after-storm&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;p class="yiv1941372453MsoNormal"&gt;&lt;font size="2" face="Arial"&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp; &lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;/div&gt;    &lt;/div&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6742075647779047106?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6742075647779047106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6742075647779047106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6742075647779047106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6742075647779047106'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/dog-blown-away-by-tornado-makes-it-back.html' title='Dog Blown Away By Tornado Makes It Back Home'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4026049394550675949</id><published>2011-05-21T10:10:00.000-05:00</published><updated>2011-05-21T10:10:18.241-05:00</updated><title type='text'>Example of A Successful Internet Site That Focuses On One Thing</title><content type='html'>I like to regularly highlight internet websites that are successful because they keep their business model simple and focus on one thing.&lt;br /&gt;&lt;br /&gt;Today's example is &lt;a href="http://www.blueskyscrubs.com/categories/Scrubs/Scrubs-for-Women/"&gt;http://www.blueskyscrubs.com/categories/Scrubs/Scrubs-for-Women/&lt;/a&gt;&lt;br /&gt;which specializes in the narrowly targeted niche of &lt;a href="http://www.blueskyscrubs.com/categories/Scrubs/Scrubs-for-Women/"&gt;nursing scrubs&lt;/a&gt; - including medical lab coats, nurse uniforms, and other accessories.&lt;br /&gt;&lt;br /&gt;Because Blue Sky Scrubs keeps it simple and specialized, their website is clutter free, well organized, and easy to navigate.  &lt;br /&gt;&lt;br /&gt;Someone interested in scrubs can quickly find and buy what they are looking for, a lot easier than shopping at a website that sells general merchandise.&lt;br /&gt;&lt;br /&gt;As a further advantage, having so many interlinked pages on the same subject will help to get them ranked as more relevant for their key search terms.&lt;br /&gt;&lt;br /&gt;That s why specialized websites are a good business model.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4026049394550675949?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4026049394550675949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4026049394550675949' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4026049394550675949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4026049394550675949'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/example-of-successful-internet-site.html' title='Example of A Successful Internet Site That Focuses On One Thing'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6406314045773731343</id><published>2011-05-21T10:01:00.000-05:00</published><updated>2011-05-21T10:01:29.111-05:00</updated><title type='text'>Running A Unix Command From Awk, and Redirecting the Ouput Back Inside the Awk Program</title><content type='html'>You can run a unix command through awk, and then access the command's output within the awk script.&lt;br /&gt;&lt;br /&gt;The trick is to use: "cmd"|getline  &lt;br /&gt;&lt;br /&gt;The first call to "cmd"|getline will open it as a pipe and fetch the first line of output.  Each subsequent call will fetch the next line of output.  If there is no output, it will return empty.&lt;br /&gt;&lt;br /&gt;For each line, $0 will be automatically assigned to the whole line, and the fields ($1, $2, etc) will be assigned by breaking up on the whitespace pattern.&lt;br /&gt;&lt;br /&gt;You can use this neatly in a while statement:&lt;br /&gt;&lt;br /&gt;while ("cmd"|getline)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is an example to print the environmental variable settings:&lt;br /&gt;&lt;br /&gt;#! /bin/nawk -f&lt;br /&gt;&lt;br /&gt;BEGIN {&lt;br /&gt;&lt;br /&gt;while ("env"|getline)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;print $0&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This will run the "env" command in a unix shell and it will keep looping until there are no more environment variables.  Each line will be printed by the print command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6406314045773731343?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6406314045773731343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6406314045773731343' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6406314045773731343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6406314045773731343'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/running-unix-command-from-awk-and.html' title='Running A Unix Command From Awk, and Redirecting the Ouput Back Inside the Awk Program'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2160235972767310424</id><published>2011-05-21T09:59:00.001-05:00</published><updated>2011-05-21T09:59:36.383-05:00</updated><title type='text'>AWK's Split Function</title><content type='html'>&lt;div&gt;Awk has a split command, which takes a string and splits it into an array, and returns the number of elements.&amp;nbsp; The default separator is white space.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;As an&amp;nbsp;example, let us assume that a line in a logfile consists of:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#007f40&gt;4/2/2003 11:23:18 This is a log entry with timestamp.&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;and we have an awk program like this:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;{&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&amp;nbsp;&amp;nbsp; split($1,DATE,"/")&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&amp;nbsp;&amp;nbsp; n = split($2,TIME,":")&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&amp;nbsp;&amp;nbsp; print "Month is "DATE[1]&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&amp;nbsp;&amp;nbsp; print "Minutes are "TIME[2]&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&amp;nbsp; print "Time has "n" parts"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Running the program against the  logfile line would result in the following output:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#007f7f&gt;Month is 4&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#007f7f&gt;Minutes are 23&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#007f7f&gt;Time has 3 parts&lt;/FONT&gt;&lt;/div&gt;&lt;/FONT&gt;  &lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2160235972767310424?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2160235972767310424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2160235972767310424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2160235972767310424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2160235972767310424'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/awks-split-function.html' title='AWK&apos;s Split Function'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5179135116107783120</id><published>2011-05-09T14:42:00.000-05:00</published><updated>2011-05-09T14:42:13.038-05:00</updated><title type='text'>SEO Specialists for Car Dealerships</title><content type='html'>A lot of people want to hire an internet marketing company and/or web design firm to create a successful online presence.  The best results are obtained when you find a company that specializes in your field of business.&lt;br /&gt;&lt;br /&gt;They can give you an edge over a site designed by a generalized firm that lacks the specialized, detailed knowledge that specialization can give.&lt;br /&gt;&lt;br /&gt;For example, if you are a car dealer, you may want to check out a &lt;a href="http://www.showroomlogic.com/"&gt;car Dealer SEO&lt;/a&gt; firm called Show Room Logic.&lt;br /&gt;&lt;br /&gt;Besides offering PPC, advertising, and marketing advice geared specifically to car buyers, they have their very useful &lt;a href="http://www.showroomlogic.com/adlogic"&gt;AdLogic tool&lt;/a&gt; that automatically creates 8 banner ads for every car in your inventory.  This is a remarkable and useful piece of software that replaces hours of tedious work.  &lt;br /&gt;&lt;br /&gt;It solves the particular problem of car dealers in that they carry a large inventory, but each item is unique - and not just an identical widget. &lt;br /&gt;&lt;br /&gt;They also have a useful &lt;a href="http://www.showroomlogic.com/blog/"&gt;blog&lt;/a&gt; that can give you actionable advice immediately, and serve to get you familiar and comfortable with their service.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5179135116107783120?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5179135116107783120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5179135116107783120' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5179135116107783120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5179135116107783120'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/seo-specialists-for-car-dealerships.html' title='SEO Specialists for Car Dealerships'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4307868294561822723</id><published>2011-05-09T14:32:00.001-05:00</published><updated>2011-05-09T14:32:08.884-05:00</updated><title type='text'>Splitting Large Unix Files, Part 2</title><content type='html'>In &lt;a href="http://unix-simple.blogspot.com/2008/06/splitting-unix-file-into-smaller-files.html"&gt;part 1&lt;/a&gt;, we looked at using the unix split command to break up a large file into several smaller files.&lt;br /&gt;&lt;br /&gt;The split command works by putting the first n lines of the large file into a smaller file, then the next n lines into the next file, etc.&lt;br /&gt;&lt;br /&gt;But, what if we want to split the file more evenly.  In other words, what if we want to  put the first line in file 1, the second line in file2, ..., the nth line in file n, and then line n+1 goes into file 1.&lt;br /&gt;&lt;br /&gt;So, for example, if we split a file into smaller files of 20 lines each, then the first file will have lines 1, 21, 41, 61, etc.&lt;br /&gt;&lt;br /&gt;We can use awk.&lt;br /&gt;&lt;br /&gt;This script will output the file with each line having a line number from 1 to 20, which repeats:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;nawk '&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;     i++&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;     if (i &gt; 20)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;        i = 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;        print i" "$1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;}' $*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, if we had a file like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;19&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;20&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;21&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The output would be:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;1 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;2 2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;19 19&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;20 20&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;1 21&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then, you can easily extract the entries you want to build each smaller file.&lt;br /&gt;&lt;br /&gt;For example, we can build the third file with:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;awk '$1 == 3 {print $2}' my_file  &gt; my_file3&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4307868294561822723?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4307868294561822723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4307868294561822723' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4307868294561822723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4307868294561822723'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/splitting-large-unix-files-part-2.html' title='Splitting Large Unix Files, Part 2'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2455691203865940604</id><published>2011-05-09T14:31:00.002-05:00</published><updated>2011-05-09T14:31:09.455-05:00</updated><title type='text'>Splitting Large Unix Files, Part 1</title><content type='html'>Let's say that we have a large unix file.  For example, a text file called &lt;span style="font-style:italic;"&gt;my_list&lt;/span&gt; with 100,000 lines.&lt;br /&gt;&lt;br /&gt;We need the data contained in smaller files with no more than 1000 lines each.&lt;br /&gt;&lt;br /&gt;We can use the unix &lt;span style="font-style:italic;"&gt;split&lt;/span&gt; command:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;split -1000 my_list&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will create 100 files in the current directory that each contain 1000 lines from my_list.  Since we did not specify a name for the output file, the files will be named by an &lt;span style="font-style:italic;"&gt;x&lt;/span&gt;, followed by two letters of the alphabet (from &lt;span style="font-style:italic;"&gt;aa&lt;/span&gt; to &lt;span style="font-style:italic;"&gt;zz&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;So, for example, the first 1000 lines of &lt;span style="font-style:italic;"&gt;my_list&lt;/span&gt; will be in file &lt;span style="font-style:italic;"&gt;xaa&lt;/span&gt;, the next 1000 lines in &lt;span style="font-style:italic;"&gt;xab&lt;/span&gt;, the next 1000 in &lt;span style="font-style:italic;"&gt;xac&lt;/span&gt;, etc.&lt;br /&gt;&lt;br /&gt;If we had specified an output file name like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;split -1000 my_list my_list&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then the output files would have been &lt;span style="font-style:italic;"&gt;my_listaa&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;mylistab&lt;/span&gt;, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2455691203865940604?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2455691203865940604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2455691203865940604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2455691203865940604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2455691203865940604'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/splitting-large-unix-files-part-1.html' title='Splitting Large Unix Files, Part 1'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-3726467305952269086</id><published>2011-05-07T09:33:00.000-05:00</published><updated>2011-05-07T09:33:14.295-05:00</updated><title type='text'>Great Internet Site For Mother's Day</title><content type='html'>Mother's Day is tomorrow, but it's not too late to have &lt;a href="http://www.flowerdeliverydeals.com/"&gt;Mother's Day Flower Delivery&lt;/a&gt; for your mom.&lt;br /&gt;&lt;br /&gt;In fact, tomorrow is probably the biggest day of the year for floral shops.&lt;br /&gt;&lt;br /&gt;But, the internet site I'm mentioning is not an online florist or a floral network.  Instead, it's one more step specialized - it's a discount deal site that specializes in floral deliveries, that can get you &lt;a href="http://www.flowerdeliverydeals.com/proflowers.html"&gt;ProFlowers coupons&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;A great part of the internet is how sites can be laser-focused for your needs.  When shopping for anything - including Mother's Day flowers - it's better to be able to shop at one portal which specializes in presenting the products you want, from different vendors, side by side, with discount codes and &lt;a href="http://www.bestonlinecoupons.com/coupons/proflowers.asp"&gt;ProFlowers coupon codes&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;People don't have time to surf many different websites.  This way, you can get what you want, at a good price, just from one website.&lt;br /&gt;&lt;br /&gt;The online flowers business also illustrates how the internet and technological progress in general works in today's world.  The final product or service is built on top of other layers that are encapsulated - so that it is like building blocks stacked on top of other blocks.&lt;br /&gt;&lt;br /&gt;In this case, you have, at the low level, the local florist who will actually cut, arrange, and deliver the flowers to your mother. Above him is the network that routes orders to him.  Above that, you have this floral discount site, which lets you use coupon codes to pick out the proper arrangement for your mother.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-3726467305952269086?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/3726467305952269086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=3726467305952269086' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3726467305952269086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3726467305952269086'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/great-internet-site-for-mothers-day.html' title='Great Internet Site For Mother&apos;s Day'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-528381564405156352</id><published>2011-05-07T09:03:00.002-05:00</published><updated>2011-05-07T09:03:50.262-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Shell Scripts'/><title type='text'>How To Run A Unix Command In A Directory With Too Many Files</title><content type='html'>Today, a co-worker sent me an email asking for help.&lt;br /&gt;&lt;br /&gt;He was trying to run &lt;b&gt;grep pattern * &gt; /tmp/tmpfile&lt;/b&gt; in a directory containing 240,695 files and he got the error "ksh: /bin/grep: arg list too long".&lt;br /&gt;&lt;br /&gt;He thought the limitation was in &lt;b&gt;grep&lt;/b&gt; and so asked me to provide him with the equivalent &lt;b&gt;awk&lt;/b&gt; script.  I told him that it was not a &lt;b&gt;grep&lt;/b&gt; problem.  The issue is with too many arguments on the command line - so the problem would happen with &lt;b&gt;awk&lt;/b&gt; also.&lt;br /&gt;&lt;br /&gt;You simply cannot put 240,695 arguments on a command line.&lt;br /&gt;&lt;br /&gt;The solution is to use a for loop, so you are actually running the command 240,695 times with only one argument:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;for i in *&lt;br /&gt;&lt;br /&gt;do&lt;br /&gt;&lt;br /&gt;grep pattern $i &gt;&gt; /tmp/tmpfile&lt;br /&gt;&lt;br /&gt;done&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-528381564405156352?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/528381564405156352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=528381564405156352' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/528381564405156352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/528381564405156352'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/how-to-run-unix-command-in-directory.html' title='How To Run A Unix Command In A Directory With Too Many Files'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5341418495640109746</id><published>2011-05-07T09:02:00.000-05:00</published><updated>2011-05-07T09:04:02.936-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix Commands'/><title type='text'>The Unix 'cd' Command For Changing Directories</title><content type='html'>In unix, the cd command is used to change directories.  For example, cd /tmp will put you in the /tmp directory.&lt;br /&gt;&lt;br /&gt;Here are some tips/tricks for cd:&lt;br /&gt;&lt;br /&gt;cd by itself or cd ~ will always put you in your home directory.&lt;br /&gt;&lt;br /&gt;cd ~username will put you in username's home directory.&lt;br /&gt;&lt;br /&gt;cd dir (without a /) will put you in a subdirectory. for example, if you are in /usr, typing cd bin will put you in /usr/bin, while cd /bin puts you in /bin.&lt;br /&gt;&lt;br /&gt;cd ..  will move you up one directory. So, if you are /usr/bin/tmp, cd .. moves you to /usr/bin, while cd ../.. moves you to /usr (i.e. up two levels).  You can use this indirection to access subdirectories too.  So, from /usr/bin/tmp, you can use cd ../../local to go to /usr/local.&lt;br /&gt;&lt;br /&gt;cd - will switch you to the previous directory.  For example, if you are in /usr/bin/tmp, and go to /etc, you can type cd - to go back to /usr/bin/tmp.  You can use this to toggle back and forth between two directories.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5341418495640109746?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5341418495640109746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5341418495640109746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5341418495640109746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5341418495640109746'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/unix-cd-command-for-changing.html' title='The Unix &apos;cd&apos; Command For Changing Directories'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-3735071663274383814</id><published>2011-05-07T08:28:00.001-05:00</published><updated>2011-05-09T14:16:06.078-05:00</updated><title type='text'>The Changing Hosting Needs For Growing Businesses</title><content type='html'>As your business grows, your internet &lt;a href="http://www.superb.net/web-hosting"&gt;web hosting&lt;/a&gt; vendor becomes a critical choice.&lt;br /&gt;&lt;br /&gt;For blogs or small websites, you can get away with hosting on an average ISP.  However, serious small to medium businesses that need more robust and professional levels of service, might want to consider Superb Internet Corporation.&lt;br /&gt;&lt;br /&gt;They offer a choice of Linux or Windows dedicated servers and &lt;a href="http://www.superb.net/managed-hosting/"&gt;managed hosting&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;They continually re-invest in their infrastructure and forecast the future web hosting needs of businesses.&lt;br /&gt;&lt;br /&gt;If your business already has its own dedicated servers, you may want to take advantage of their &lt;a href="http://www.superb.net/colocation/"&gt;colocation&lt;/a&gt; plans - which allow them to host your servers in their highly secure data centers.  Then you don't have to worry about theft, power loss, fire, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-3735071663274383814?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/3735071663274383814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=3735071663274383814' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3735071663274383814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3735071663274383814'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/changing-hosting-needs-for-growing.html' title='The Changing Hosting Needs For Growing Businesses'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4298094726476005996</id><published>2011-05-03T22:40:00.001-05:00</published><updated>2011-05-03T22:40:44.210-05:00</updated><title type='text'>Fw:  9 things that will disappear in our lifetime...</title><content type='html'>&lt;table cellspacing="0" cellpadding="0" border="0" &gt;&lt;tr&gt;&lt;td valign="top" style="font: inherit;"&gt;&lt;br&gt;&lt;br&gt;&lt;blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"&gt;&lt;br&gt;&lt;div id="yiv633830440"&gt;&lt;style type="text/css"&gt;&lt;!--#yiv633830440 DIV {margin:0px;}--&gt;&lt;/style&gt;&lt;div style="font-family: times,serif; font-size: 10pt;"&gt;&lt;div&gt;&lt;span class="yiv633830440Apple-style-span" style="font-family: Tahoma; font-size: small;"&gt;&lt;b&gt;&lt;span style="font-weight: bold;"&gt;Subject:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="yiv633830440Apple-style-span" style="font-family: Tahoma; font-size: small;"&gt; Fwd: 9 things that will disappear in our lifetime...&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: times,serif; font-size: 10pt;"&gt;&lt;div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"&gt;&lt;div style="font-family: bookman old style,new york,times,serif; font-size: 12pt;"&gt;&lt;div style="font-family: bookman old style,new york,times,serif; font-size:  12pt;"&gt;&lt;div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"&gt;&lt;br&gt;   &lt;style type="text/css"&gt;#yiv633830440 p {margin:0;}&lt;/style&gt;  &lt;div style="font-family: Arial; color: rgb(0, 0, 0); font-size: 12pt;"&gt; &lt;div&gt; &lt;blockquote&gt; &lt;div&gt; &lt;div style="margin: 0px; min-height: 14px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium Helvetica; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px;" class="yiv633830440Apple-style-span"&gt; &lt;div&gt; &lt;div style="font-family: Arial; color: rgb(0, 0, 0); font-size: 12pt;"&gt;&lt;span id="yiv633830440OLK_SRC_BODY_SECTION"&gt; &lt;div&gt; &lt;div class="yiv633830440hmmessage"&gt; &lt;div style="font-family: Arial; color: rgb(0, 0, 0); font-size: 12pt;"&gt; &lt;div style="font-family: Arial; color: rgb(0, 0, 0); font-size: 12pt;"&gt; &lt;div class="yiv633830440ecxgmail_quote"&gt; &lt;div class="yiv633830440ecxgmail_quote"&gt; &lt;div class="yiv633830440ecxgmail_quote"&gt; &lt;div&gt; &lt;div style="background-color: rgb(255, 255, 255); font-family: arial,helvetica,sans-serif; color: rgb(0, 0, 0); font-size: 12pt;"&gt; &lt;div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt; &lt;div style="font-family: times,serif; font-size: 12pt;"&gt; &lt;div&gt; &lt;table border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top"&gt; &lt;blockquote style="padding-left: 5px; margin-left: 5px;"&gt; &lt;div&gt; &lt;table border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top"&gt; &lt;blockquote style="padding-left: 5px; margin-left: 5px;"&gt; &lt;div&gt; &lt;table border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top"&gt; &lt;blockquote style="padding-left: 5px; margin-left: 5px;"&gt; &lt;div&gt; &lt;div&gt; &lt;div&gt; &lt;div style="font-family: times,serif; font-size: 12pt;"&gt; &lt;div style="font-family: times,serif; font-size: 12pt;"&gt; &lt;div style="font-family: times,serif; font-size: 12pt;"&gt; &lt;div&gt; &lt;div&gt; &lt;div&gt;&lt;span style="font-family: Arial; font-size: medium;"&gt;&lt;font color="#c20000" face="Verdana" size="3"&gt;&lt;b&gt;&lt;i&gt;9 things that will disappear in our lifetime...&lt;/i&gt;&lt;/b&gt;&lt;/font&gt;  &lt;table&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td width="100%"&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;  &lt;table&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td width="100%"&gt;&lt;font color="#800080" face="Times New Roman" size="3"&gt;&lt;b&gt;Whether these changes are good or &amp;nbsp;bad depends in part on how we adapt to them. But, &amp;nbsp;ready or not, here they come.&amp;nbsp;&lt;br&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&lt;b&gt;&lt;br&gt;1.&amp;nbsp;&lt;u&gt;The &amp;nbsp;&lt;span style="color: rgb(54, 99, 136);"&gt;Post Office&lt;/span&gt;.&lt;/u&gt;&amp;nbsp;&amp;nbsp;Get ready to imagine a world without the post office. &amp;nbsp;They are so deeply in financial trouble that there is probably no way to sustain it long term. &amp;nbsp;Email, Fed Ex, and UPS have just about wiped out the minimum revenue needed to keep the post office alive. &amp;nbsp;Most of your mail every day is junk mail and bills. &amp;nbsp;&lt;br&gt;&lt;br&gt;2.&amp;nbsp;&lt;u&gt;The Check.&lt;/u&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(54, 99, 136);"&gt;Britain&lt;/span&gt;&amp;nbsp;is already laying the groundwork to do away with checks by 2018. &amp;nbsp;It costs the financial system billions  of  dollars  a year to process checks. &amp;nbsp;Plastic cards and &amp;nbsp;online transactions will lead to the eventual demise of the check. &amp;nbsp;This plays right into the death of the post office. &amp;nbsp;If you never paid your bills by mail and never received them by mail, the post office would absolutely go out of business.&amp;nbsp;&lt;br&gt;&lt;br&gt;3.&amp;nbsp;&lt;u&gt;&lt;span style="color: rgb(54, 99, 136);"&gt;The &amp;nbsp;Newspaper&lt;/span&gt;.&lt;/u&gt;&amp;nbsp;&amp;nbsp;The younger generation simply doesn't read the newspaper. &amp;nbsp;They certainly don't subscribe to a daily delivered print edition. &amp;nbsp;That may go the way of the milkman and the laundry man. &amp;nbsp;As for reading the paper online, get ready to pay for it. The rise in mobile Internet devices and e-readers has caused all the newspaper and magazine publishers to form an alliance. &amp;nbsp;They have met with&amp;nbsp;&lt;span style="color: rgb(54, 99, 136);"&gt;Apple&lt;/span&gt;, Amazon, and the major cell phone companies to develop a model for paid subscription  services.&amp;nbsp;&lt;br&gt;&lt;br&gt;4.&amp;nbsp;&lt;u&gt;The Book.&lt;/u&gt;&amp;nbsp;&amp;nbsp;You say you will never give up the physical book that you hold in your hand and turn the literal pages. &amp;nbsp;I said the same thing about downloading music fromiTunes. &amp;nbsp;I wanted my hard copy CD. &amp;nbsp;But I quickly changed my mind when I discovered that I could get albums for half the price without ever leaving home to get the latest music. &amp;nbsp;&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;br&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&amp;nbsp;&lt;br&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&lt;b&gt;The same thing will happen with books. &amp;nbsp;You can browse a bookstore online and even read a preview chapter before you buy. &amp;nbsp;And the price is less than half that of a real book. &amp;nbsp;And think of the &amp;nbsp;convenience! &amp;nbsp;Once you start flicking your fingers on the screen instead of the book, you find  that  you are lost in the story, can't wait to see what happens next, and you forget that you're holding a gadget instead of a book.&amp;nbsp;&lt;br&gt;&lt;br&gt;5.&amp;nbsp;&lt;u&gt;The Land Line Telephone.&lt;/u&gt;&amp;nbsp;&amp;nbsp;Unless you have a large family and make a lot of local calls, you don't need it anymore. &amp;nbsp;Most people keep it simply because they've always had it. &amp;nbsp;But you are paying double charges for that extra &amp;nbsp;service. &amp;nbsp;All the cell phone companies will let you call customers using the same cell provider for no charge against your minutes&amp;nbsp;&lt;br&gt;&lt;br&gt;6.&amp;nbsp;&lt;u&gt;Music.&lt;/u&gt;&amp;nbsp;&amp;nbsp;This is one of the saddest parts of the change story. &amp;nbsp;The music industry is dying a slow death. &amp;nbsp;Not just because of illegal downloading. &amp;nbsp;It's the lack of innovative new music being given a chance to get to the people who would like to hear it. &amp;nbsp;Greed and &amp;nbsp;corruption is the problem. &amp;nbsp;The record labels and the radio conglomerates are simply  self-destructing. &amp;nbsp;&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;br&gt;&lt;font face="Times                                                          New                                                                                                                      Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&amp;nbsp;&lt;br&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&lt;b&gt;Over 40% of the music purchased today is "catalog items," meaning traditional music that the public is familiar with. &amp;nbsp;Older established artists. &amp;nbsp;This is also true on the live concert circuit. &amp;nbsp;To explore this fascinating and disturbing topic further, check out the book, &amp;nbsp;"Appetite for Self-Destruction" by Steve Knopper, and the video documentary, "&lt;span style="background-color: transparent; color: rgb(54, 99, 136);"&gt;Before the Music Dies&lt;/span&gt;." &amp;nbsp;&lt;br&gt;&lt;br&gt;7.&amp;nbsp;&lt;u&gt;Television.&lt;/u&gt;&amp;nbsp;&amp;nbsp;Revenues to the networks are down dramatically. &amp;nbsp;Not just  because  of the economy. &amp;nbsp;People are watching TV and movies streamed from their computers. And they're playing games and doing lots of other things that take up the time that used to be spent watching TV. &amp;nbsp;&lt;span style="color: rgb(54, 99, 136);"&gt;Prime time&lt;/span&gt;&amp;nbsp;shows have degenerated down to lower than the lowest common denominator. &amp;nbsp;&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;br&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&amp;nbsp;&lt;br&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&lt;b&gt;Cable rates are skyrocketing and commercials run about every 4 minutes and 30 seconds. &amp;nbsp;I say good riddance to most of it. &amp;nbsp;It's time for the cable companies to be put out of our misery. &amp;nbsp;Let the people choose what they want to watch online and through&amp;nbsp;&lt;span style="color: rgb(54, 99, 136);"&gt;Netflix&lt;/span&gt;. &amp;nbsp;&lt;br&gt;&lt;br&gt;8.&amp;nbsp;&lt;u&gt;The "Things" That You  Own.&lt;/u&gt;&amp;nbsp;&amp;nbsp;Many of the very possessions that we used to own are still in our lives, but we may not actually own them in the future. &amp;nbsp;They may simply reside in "the cloud." &amp;nbsp;Today your computer has a hard drive and you store your pictures, music, movies, and documents. &amp;nbsp;Your software is on a CD or DVD, and you can always re-install it if need be. &amp;nbsp;But all of that is changing. &amp;nbsp;Apple, Microsoft, and&amp;nbsp;&lt;span style="color: rgb(54, 99, 136);"&gt;Google&lt;/span&gt;&amp;nbsp;are all finishing up their latest "cloud services." &amp;nbsp;That means that when you turn on a computer, the Internet will be built into the operating system. &amp;nbsp;&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;br&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&amp;nbsp;&lt;br&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&lt;b&gt;So, Windows, Google, and the Mac OS will be tied straight into the  Internet.  &amp;nbsp;If you click an icon, it will open something in the Internet cloud. &amp;nbsp;If you save something, it will be saved to the cloud. &amp;nbsp;And you may pay a monthly &amp;nbsp;subscription fee to the cloud provider. &amp;nbsp;In this virtual world, you can access your music or your books, or your whatever from any laptop or handheld &amp;nbsp;device&lt;/b&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;b&gt;. &amp;nbsp;That's the good news. But, will you actually own any of this "stuff" or will it all be able to disappear at any moment in a big "Poof?" &amp;nbsp;Will most of the things in our lives be disposable and whimsical? &amp;nbsp;It makes you want to run to the closet and pull out that photo album, grab a book from the shelf, or open up a CD case and pull out the insert. &amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&lt;b&gt;&lt;br&gt;&lt;br&gt;9.&amp;nbsp;&lt;u&gt;Privacy.&lt;/u&gt;&amp;nbsp;&amp;nbsp;If there ever was a concept that we can look back on nostalgically, it  would be  privacy. That's gone. &amp;nbsp;It's been gone for a long time anyway. &amp;nbsp;There are cameras on the street, in most of the buildings, and even built into your computer and cell phone. &amp;nbsp;&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;br&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&amp;nbsp;&lt;br&gt;&lt;font face="Times                                                          New Roman" size="3"&gt;&lt;b&gt;But you can be sure that 24/7, "They" know who you are and where you are, right down to the GPS coordinates, and the Google Street View. &amp;nbsp;If you buy something, your habit is put into a &amp;nbsp;zillion profiles, and your ads will change to reflect those habits. &amp;nbsp;And "They" will try to get you to buy something else. &amp;nbsp;Again and again. &amp;nbsp;&lt;br&gt;&lt;br&gt;All we will have that can't be changed are  Memories.&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;br class="yiv633830440Apple-interchange-newline"&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: times,serif; font-size: 10pt;"&gt;&lt;/div&gt;   &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4298094726476005996?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4298094726476005996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4298094726476005996' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4298094726476005996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4298094726476005996'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/fw-9-things-that-will-disappear-in-our.html' title='Fw:  9 things that will disappear in our lifetime...'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8120161439429905472</id><published>2011-05-01T00:30:00.001-05:00</published><updated>2011-05-01T00:30:09.884-05:00</updated><title type='text'>My Book "Sudoku Fun: Volume 2" Reached #76 on Amazon.com's Bestseller List for Sudoku Books</title><content type='html'>&lt;table cellspacing="0" cellpadding="0" border="0" &gt;&lt;tr&gt;&lt;td valign="top" style="font: inherit;"&gt;My second Sudoku book, "Sudoku Fun: Volume 2" reached #76 on Amazon.com's Bestseller List for the category "Entertainment-&amp;gt;Puzzles &amp;amp; Games-&amp;gt;Sudoku".&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8120161439429905472?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8120161439429905472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8120161439429905472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8120161439429905472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8120161439429905472'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/05/my-book-sudoku-fun-volume-2-reached-76.html' title='My Book &quot;Sudoku Fun: Volume 2&quot; Reached #76 on Amazon.com&apos;s Bestseller List for Sudoku Books'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-3075717363645089540</id><published>2011-04-16T13:08:00.000-05:00</published><updated>2011-04-16T13:08:54.247-05:00</updated><title type='text'>Secure Data Rooms</title><content type='html'>As IT professionals, we know that the trend is for computing to move into "the cloud".  This is especially convenient for situations where large, distributed teams need to share documents and data.&lt;br /&gt;&lt;br /&gt;But two industries that can really use this - legal and financial companies - have resisted due to the need for strict confidentiality.&lt;br /&gt;&lt;br /&gt;Now, I heard about a company called Merril DataSite - which provides &lt;a href="http://www.datasite.com"&gt;virtual data room&lt;/a&gt;s for capital market / financing functions such as mergers and acquisitions (M&amp;A) activities, business ownership transfers, bankruptcies, restructurings, licensing activities, etc.&lt;br /&gt;&lt;br /&gt;Basically, their data sites are useful for any firms that are involved in complex business, financial, and/or legal processes that involve sharing highly confidential documents (such as &lt;a href="http://www.datasite.com/financial-due-diligence.htm"&gt;due diligence checklist&lt;/a&gt;s) between groups of financial analysts, lawyers, and / or accountants.&lt;br /&gt;&lt;br /&gt;A secure data site process can insure that the documents stay protected from outsiders by limiting access to only authorized individuals, and keeping track of checkouts and revisions.&lt;br /&gt;&lt;br /&gt;In an interesting, and natural, extension of their business, a division of Merril provides document &lt;a href="http://www.merrillbrink.com/"&gt;Translation Services&lt;/a&gt; for international clients.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-3075717363645089540?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/3075717363645089540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=3075717363645089540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3075717363645089540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3075717363645089540'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/04/secure-data-rooms.html' title='Secure Data Rooms'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6509254844026331014</id><published>2011-04-15T22:57:00.001-05:00</published><updated>2011-04-15T22:57:46.777-05:00</updated><title type='text'>Interesting Article on Walter Breuning, The World's Oldest Man</title><content type='html'>&lt;table cellspacing="0" cellpadding="0" border="0" &gt;&lt;tr&gt;&lt;td valign="top" style="font: inherit;"&gt;Walter Breuning, the world's oldest man, died Thursday at age 114.&lt;br&gt;&lt;br&gt;The Associated Press &lt;a href="http://news.yahoo.com/s/ap/20110415/ap_on_re_us/us_obit_world_s_oldest_man"&gt;article on his death&lt;/a&gt; included his story - based on an interview they did with him last October.&amp;nbsp; It's very interesting reading, because they framed his story in parallel with the history of the U.S.&lt;br&gt;&lt;br&gt;Some highlights:&lt;br&gt;&lt;br&gt;0. His mother died at 46, and his father at 50, so he didn't have longevity in the family.&amp;nbsp; His advice for living a long life:&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a) Embrace change.&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b) Eat only 2 meals a day.&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c) Work as long as you can.&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d) Help others.&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; e) Accept death.&lt;br&gt;&lt;br&gt;&lt;br&gt;1. His earliest memory is at 3 -  with his grandfather horrifying him by telling stories of killing Southerners during the Civil War.&lt;br&gt;&lt;br&gt;2. In 1912, his parents split up and he had to work on the railroad at 16.&amp;nbsp; He ended up working there for the next 50 years.&amp;nbsp; &lt;br&gt;&lt;br&gt;3. His mother died at 46 and his father at 50.&lt;br&gt;&lt;br&gt;4. In 1919, he bought his first car, and said it spooked the horses that he had to share the street with.&lt;br&gt;&lt;br&gt;5. He got married in 1922, and bought vacant land for $15.&amp;nbsp; The Depression hit and he was never able to build a house.&amp;nbsp; Eventually he sold the land for $25, making a $10 profit.&lt;br&gt;He never bought property again and was a lifetime renter.&lt;br&gt;&lt;br&gt;6. His wife died in 1957 - they had no children, and he never remarried.&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6509254844026331014?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6509254844026331014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6509254844026331014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6509254844026331014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6509254844026331014'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/04/interesting-article-on-walter-breuning.html' title='Interesting Article on Walter Breuning, The World&apos;s Oldest Man'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4986976058807275709</id><published>2011-04-15T17:42:00.000-05:00</published><updated>2011-04-15T17:42:16.391-05:00</updated><title type='text'>Keeping Your Computer Running Smoothly Takes Maintainance</title><content type='html'>When you first get a new PC, it runs fast and efficiently.  But, as time goes by, you end up with a &lt;a href="http://www.auslogics.com/en/software/boost-speed/"&gt;slow computer&lt;/a&gt;.  &lt;br /&gt;&lt;br /&gt;PC's were designed before the internet and world wide web, so it does not have an efficient way to keep "online debris" from piling up.  Not only does this affect your computer's performance, but it can make you vulnerable to privacy issues - because of cookies and lists of your browsing history piling up.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The solution to &lt;a href="http://www.auslogics.com/en/"&gt;speed up computer&lt;/a&gt; is to invest in software that will &lt;a href="http://www.auslogics.com/en/"&gt;maintain your PC&lt;/a&gt;.  This includes deleting your browser history, old temp files, and defragging your hard disk to optimize space.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4986976058807275709?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4986976058807275709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4986976058807275709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4986976058807275709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4986976058807275709'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/04/keeping-your-computer-running-smoothly.html' title='Keeping Your Computer Running Smoothly Takes Maintainance'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5936826975745865987</id><published>2011-04-15T17:31:00.001-05:00</published><updated>2011-04-15T17:31:46.369-05:00</updated><title type='text'>Sending Automated Emails From A Unix Script</title><content type='html'>Sometimes I need my unix script to email the output to a mailing list.&lt;br /&gt;&lt;br /&gt;Here is how I do it:&lt;br /&gt;&lt;br /&gt;1. I set a unix variable called MAIL_LIST that holds all the email addresses in a space separated list.&lt;br /&gt;&lt;br /&gt;MAIL_LIST="john.doe@acme.com bob_jones@somewhere.org"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. I set a variable SUBJ that holds the subject of the email.&lt;br /&gt;&lt;br /&gt;SUBJ="Daily Report For "`date`&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Instead of sending the output of the script to standard out, I send it to a temp file. (Here is &lt;a href="http://unix-simple.blogspot.com/2009/01/creating-uniquely-named-temp-files-from.html"&gt;how to generate a unique temp file&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. At the end of the script, before exiting, I use /usr/bin/mailx to email the output.&lt;br /&gt;&lt;br /&gt;cat $TMP| /usr/bin/mailx -s "$SUBJ" $MAIL_LIST&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5936826975745865987?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5936826975745865987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5936826975745865987' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5936826975745865987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5936826975745865987'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/04/sending-automated-emails-from-unix.html' title='Sending Automated Emails From A Unix Script'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8441768357905211665</id><published>2011-04-15T17:27:00.000-05:00</published><updated>2011-04-15T17:27:12.599-05:00</updated><title type='text'>For Bloggers and Websites: An Affiliate Program Specializing in Financial Products</title><content type='html'>If you have your own blogs or websites, you might be interested in some ideas for monetizing it.  One way to make money is to display affiliate ads.  &lt;br /&gt;&lt;br /&gt;With an affiliate ad, you get paid if a viewer takes some action - such as making a purchase, giving their email address, filling out a form, etc.  One of the more lucrative affiliate areas are for financial products, such as &lt;a href="http://www.blueglobalmedia.com/payday-affiliate-program.html"&gt;Payday affiliate program&lt;/a&gt;s.  These products typically involve relatively large purchases, so the companies are willing to pay more to affiliates.&lt;br /&gt;&lt;br /&gt;In fact, there is a company called &lt;a href="http://www.blueglobalmedia.com/"&gt;Blue Global Media&lt;/a&gt; that is a specialized financial &lt;a href="http://www.blueglobalmedia.com/"&gt;Affiliate network&lt;/a&gt;.  To keep things simple, you can just deal through them and find affiliate offers for things like credit reports, cards, payday loans, etc. that offer lucrative payouts.  &lt;br /&gt;&lt;br /&gt;Then, you don't have to deal directly with lots of individual advertisers.  You will also get paid through Blue Global, so that cuts down on paper work and tracking accounts receivable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8441768357905211665?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8441768357905211665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8441768357905211665' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8441768357905211665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8441768357905211665'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/04/for-bloggers-and-websites-affiliate.html' title='For Bloggers and Websites: An Affiliate Program Specializing in Financial Products'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2470768176616850968</id><published>2011-04-15T17:16:00.001-05:00</published><updated>2011-04-15T17:16:19.933-05:00</updated><title type='text'>Estimating the Internal Rate Of Return of an Investment Using AWK</title><content type='html'>On my &lt;a href="http://math-play.blogspot.com/"&gt;math and logic blog&lt;/a&gt;, I have a &lt;a href="http://math-play.blogspot.com/2010/07/quick-and-dirty-method-for-calculating.html"&gt;post explaining a quick and dirty method of calculating the approximate rate of return&lt;/a&gt; for a investment where additional funds were added during the year.&lt;br /&gt;&lt;br /&gt;In this post, I will present an Awk script for implementing this method.&lt;br /&gt;&lt;br /&gt;Basically, we want to read in a file with three fields: the starting value, ending value, and amount added during the time period.  Each line could be a different year, month, etc.&lt;br /&gt;&lt;br /&gt;For example, a line of:&lt;br /&gt;&lt;br /&gt;10000 15000 2000&lt;br /&gt;&lt;br /&gt;means that our investment started the time period with a value of $10,000, finished with a value of $15,000, and we added an additional $2,000 into the investment during the course of the time period.&lt;br /&gt;&lt;br /&gt;We can't simply say that we converted $12,000 into $15,000 because we did not have $12,000 invested throughout the time period.&lt;br /&gt;&lt;br /&gt;The quick and dirty method is to add 1/2 the additional amount to the starting balance and subtract 1/2 the additional amount from the ending balance.  This method works best when the additional money was contributed in regular deposits across the time period.&lt;br /&gt;&lt;br /&gt;So, for the example above, the return would be 14000/11000 = a return of 27.27%.&lt;br /&gt;&lt;br /&gt;Finally, the awk script outputs the total return from all entries of the file. So, if the file represented the year, and each line represented a month, the program will calculate 12 monthly returns and the yearly return.&lt;br /&gt;&lt;br /&gt;Here is the awk script:&lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;BEGIN {tret = 1}&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;{&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;start = $1&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;end = $2&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;start += $3/2&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;end -= $3/2&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;ret = end/start&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;tret *= ret&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;print $0" "ret&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;}&lt;/div&gt;&lt;div style="color: red;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: red;"&gt;END {print "return = "tret }&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2470768176616850968?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2470768176616850968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2470768176616850968' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2470768176616850968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2470768176616850968'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/04/estimating-internal-rate-of-return-of.html' title='Estimating the Internal Rate Of Return of an Investment Using AWK'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-455428895951116268</id><published>2011-04-08T17:57:00.001-05:00</published><updated>2011-04-08T17:57:14.969-05:00</updated><title type='text'>Voice Over Actors for Presentations and Spcecial Projects</title><content type='html'>If you do a lot of videos, advertisements, seminars, or demonstrations for your business, or industry, then you may want to use &lt;a href="http://www.studiocenter.com/"&gt;voice actors&lt;/a&gt; from a professional &lt;a href="http://www.studiocenter.com/"&gt;video production company&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.studiocenter.com/"&gt;voice over actors&lt;/a&gt; and commercial production values can make your videos more memorable and effective.&lt;br /&gt;&lt;br /&gt;For example, voice over acting talent can take a dry industrial or technical presentation and interject life and personality into it.  They can make it seem like a lively lecture. &lt;br /&gt;&lt;br /&gt;You may think that technical expertise is enough, but the truth is that technical proficiency is expected, and people are not inspired by a recitation of facts.  Humans are hard-wired to respond to compe1ling story-tellers, so even the most technical of audiences will understand, retain, and recall your presentation better if they hear it from talented voice actors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-455428895951116268?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/455428895951116268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=455428895951116268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/455428895951116268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/455428895951116268'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/04/voice-over-actors-for-presentations-and.html' title='Voice Over Actors for Presentations and Spcecial Projects'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6083353360212626102</id><published>2011-04-08T17:55:00.000-05:00</published><updated>2011-04-08T17:55:55.977-05:00</updated><title type='text'>Converting Temperatures in Awk</title><content type='html'>&lt;div id=yiv1335709365&gt;&lt;div&gt;Here is an awk program to convert between celcius and Fahrenheit temperatures.&amp;nbsp; &lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;Unlike most of my programs, this program is interactive.&amp;nbsp; Once started, it interacts with the user at the command line, and accepts commands until the user quits.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;Here is the run:&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#007f40&gt;[&lt;/FONT&gt;&lt;font color=#007f40&gt;513]-&amp;gt;&lt;/FONT&gt; cel_fahr&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;Current input set to: fahrenheit&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;enter q, f, c, or temp:&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;212&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;212 degrees F is 100 degrees C&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;Current input set to: fahrenheit&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font  color=#007f40&gt;enter q, f, c, or temp:&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;rt&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;Current input set to: fahrenheit&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;enter q, f, c, or temp:&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;c&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;Current input set to: celcius&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;enter q, f, c, or temp:&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;0&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;0 degrees C is 32 degrees F&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#007f40&gt;Current input set to: celcius&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#007f40&gt;enter q, f, c, or temp:&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;q&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;In the run above, the user input is in  black, while the displayed text is in green.&amp;nbsp; Notice that when I type in a number, the system interprets it as either degrees C or F (depending on the input setting), and prints the conversion.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;If I type "c" or "f", the input units are changed.&amp;nbsp; If I type "q", the system quits.&amp;nbsp; If I type anything else that is not a number (example "rt"), the program ignores it.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;Here is the script:&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#800000&gt;nawk '&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;BEGIN {&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;f = "fahrenheit"&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;c = "celcius"&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;choice = f&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;while (x != "q")&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;{&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;print&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;print "Current input set to: "choice&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;print "enter q, f, c, or temp: "&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;"read x;echo $x"|getline x&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;close "read x;echo $x"&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;if (x == "f") choice = f&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;if (x == "c") choice = c&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;if (x ~ /^[0-9]*$/ || -1*x ~ /^[0-9]*$/)&lt;/FONT&gt;&lt;/DIV&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#800000&gt;{&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;if (choice == f)&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;print x" degrees F is "5/9 * (x - 32)" degrees C"&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;if (choice == c)&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;print x" degrees C is "x*9/5 + 32"  degrees F"&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&lt;font color=#800000&gt;}'&lt;/FONT&gt;&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;Let's analyze the script.&amp;nbsp; First, this script is completely in a BEGIN section, so it is a procedural program. We set the default choice to be fahrenheit, and then loop until&amp;nbsp;the user enters a "q".&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;In the loop, we start by printing the menu, and then use getline to create a shell process which reads from the keyboard into unix variable x and then echos unix variable x into getline, where it is assigned to x in the awk program.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;We then close the process so that, the next time we run the process, it will do a fresh read.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;If the input is either "f" or "c", we set the choice.&lt;/DIV&gt;&lt;div&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div&gt;Then, if the input is either a positive or negative  number, we convert it from the input units to the other unit, and display the result.&lt;/DIV&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;!-- toctype = X-unknown --&gt;&lt;!-- toctype = text --&gt;&lt;!-- text --&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6083353360212626102?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6083353360212626102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6083353360212626102' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6083353360212626102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6083353360212626102'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/04/converting-temperatures-in-awk.html' title='Converting Temperatures in Awk'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5988822403529386</id><published>2011-04-08T17:52:00.001-05:00</published><updated>2011-04-08T17:52:46.658-05:00</updated><title type='text'>Oracle SQL "Where" Clauses</title><content type='html'>Yesterday, I had to write three Oracle SQL queries.   I have written countless queries but, this time, all three caused me to learn a new trick when writing the where clause.&lt;br /&gt;&lt;br /&gt;For the first one, I had to select rows that had a space somewhere in the middle of a varchar field.  I figured out how to select this because, when there is a space in the middle of the field,  instr(field, ' ') &gt; 1.  This Oracle function returns the position in field field where the space occurs.  If it returns a number greater than 1, it means there is a space (otherwise = 0), and it is not in the begining ( = 1).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the second query, I had to select rows that had all numbers in a varchar field.  I looked on the internet, but did not see a straight-forward Oracle function to determine if a varchar field (which can hold alphanumeric data) is numeric only.  Finally, I found a simple and elegant trick:  if a field is numeric only, lower(field) = upper(field).  Note that this is true only if the field is all numbers - i.e. no dashes, periods, spaces, etc.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the third query, I had to select rows that had colons at certain positions inside a varchar field.  I used the handy instr function from the first solution.  I added the next option - the position in the fist string to start looking for a match (by default, it is the first position).  So, for example, instr(field, ':',36) &gt; 0.  would be true if the 36th position had a colon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5988822403529386?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5988822403529386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5988822403529386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5988822403529386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5988822403529386'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/04/oracle-sql-where-clauses.html' title='Oracle SQL &quot;Where&quot; Clauses'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5551166138922218552</id><published>2011-03-25T15:51:00.000-05:00</published><updated>2011-03-25T15:51:20.365-05:00</updated><title type='text'>Like Programming, Business is Better When Kept Simple</title><content type='html'>So many businesses mess things up by getting distracted, and trying to focus on too many opportunities.  They tend to complicate their business over time.&lt;br /&gt;&lt;br /&gt;I recently read about a &lt;a href="http://www.thesteamteam.com/austin-carpet-cleaning/"&gt;Carpet Cleaning Onion Creek&lt;/a&gt;.  This Texas carpet cleaning business has been successful for 25 years because they keep things simple.  &lt;br /&gt;&lt;br /&gt;They stayed focused on providing &lt;a href="http://www.thesteamteam.com/austin-carpet-cleaning/"&gt;Carpet Cleaning The Hills&lt;/a&gt;, and gradually expanded into providing the same service to different communities, such as &lt;a href="http://www.thesteamteam.com/austin-carpet-cleaning/"&gt;Carpet Cleaning Webberville&lt;/a&gt; and &lt;a href="http://www.thesteamteam.com/austin-carpet-cleaning/"&gt;Carpet Cleaning Lockhart&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;By not pursuing opportunities outside their realm of expertise, The Steam Team was able to master their field, build up loyal clientele, and stay up to date on the latest techniques related to carpet and floor cleaning.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5551166138922218552?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5551166138922218552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5551166138922218552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5551166138922218552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5551166138922218552'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/like-programming-business-is-better.html' title='Like Programming, Business is Better When Kept Simple'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-1880354625881300537</id><published>2011-03-25T15:38:00.001-05:00</published><updated>2011-03-25T15:38:11.460-05:00</updated><title type='text'>Linguistics and Recursion</title><content type='html'>I read a very interesting article in the Sunday, June 10, 2007 Metro section of the Chicago Tribune.&lt;br /&gt;&lt;br /&gt;MIT's Noam Chomsky is considered the Einstein of Linguistics.  His work revolutionized the field, just as Einstein's Theory of Relativity transformed physics.  One of his key theories is that all human language employ &lt;span style="font-style:italic;"&gt;recursion&lt;/span&gt;, which allows humans to share complex thoughts.  It is what separates human language from animal squawks and grunts.&lt;br /&gt;&lt;br /&gt;For example, in the nursery rhyme "This is the cat that chased the rat that ate the malt that lay in the house that Jack built", the word "that" is a recursive device.  It directs the listener to not just any cat, but specifically, the cat that chased the rat.&lt;br /&gt;&lt;br /&gt;Recently, however, an unknown linguist from Illinois State University has contradicted Chomsky's theory, and stirred up the field.&lt;br /&gt;&lt;br /&gt;This linguist, Dan Everett, has spent 30 years doing field work with the Piraha, a tiny tribe in the Amazon.  He now speaks their obscure language fluently, and has found that they don't use recursives.  &lt;br /&gt;&lt;br /&gt;So, while Chomsky supporters discount his findings, people who support Everett now feel that recursion evolved in human language.  It may not be, as Chomsky theorizes, hard-wired.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-1880354625881300537?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/1880354625881300537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=1880354625881300537' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1880354625881300537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/1880354625881300537'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/linguistics-and-recursion.html' title='Linguistics and Recursion'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2044396628972950100</id><published>2011-03-25T15:36:00.001-05:00</published><updated>2011-03-25T15:36:02.866-05:00</updated><title type='text'>AWK's Split Function</title><content type='html'>&lt;div&gt;Awk has a split command, which takes a string and splits it into an array, and returns the number of elements.&amp;nbsp; The default separator is white space.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;As an&amp;nbsp;example, let us assume that a line in a logfile consists of:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#007f40&gt;4/2/2003 11:23:18 This is a log entry with timestamp.&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;and we have an awk program like this:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;{&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&amp;nbsp;&amp;nbsp; split($1,DATE,"/")&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&amp;nbsp;&amp;nbsp; n = split($2,TIME,":")&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&amp;nbsp;&amp;nbsp; print "Month is "DATE[1]&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&amp;nbsp;&amp;nbsp; print "Minutes are "TIME[2]&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;&amp;nbsp; print "Time has "n" parts"&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#c00000&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Running the program against the  logfile line would result in the following output:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#007f7f&gt;Month is 4&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#007f7f&gt;Minutes are 23&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#007f7f&gt;Time has 3 parts&lt;/FONT&gt;&lt;/div&gt;&lt;/FONT&gt;  &lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2044396628972950100?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2044396628972950100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2044396628972950100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2044396628972950100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2044396628972950100'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/awks-split-function.html' title='AWK&apos;s Split Function'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5415444003440709042</id><published>2011-03-25T15:30:00.000-05:00</published><updated>2011-03-25T15:30:21.123-05:00</updated><title type='text'>How to Find A Host For Your Website</title><content type='html'>WebHostingGeeks.com is a resource that you can use to evaluate different &lt;a href="http://webhostinggeeks.com"&gt;web hosting&lt;/a&gt; companies.  They record the votes of volunteers who rank and review People rank and review their webhosts.&lt;br /&gt;&lt;br /&gt;This site is user friendly for navigation, and ranks hosting companies several times, by how they rank on various lists. &lt;br /&gt;&lt;br /&gt;For example, they have an overall top 10 webhosts, but they also have categories like the best hosts with &lt;a href="http://webhostinggeeks.com/multipledomainhosting.html"&gt;multiple domain hosting&lt;/a&gt;, &lt;a href="http://webhostinggeeks.com/dedicatedserverhosting.html"&gt;dedicated server hosting&lt;/a&gt;, etc.&lt;br /&gt;&lt;br /&gt;One category I found interesting was the best &lt;a href="http://webhostinggeeks.com/greenwebhosting.html"&gt;green web hosts&lt;/a&gt;, where they look at data centers that buy power from renewable sources, recycle waste, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5415444003440709042?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5415444003440709042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5415444003440709042' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5415444003440709042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5415444003440709042'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/how-to-find-host-for-your-website.html' title='How to Find A Host For Your Website'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5503501353060432724</id><published>2011-03-25T15:28:00.000-05:00</published><updated>2011-03-25T15:28:05.958-05:00</updated><title type='text'>Unix and Hemingway</title><content type='html'>I read a good blog post on &lt;a href="http://www.copyblogger.com/ernest-hemingway-top-5-tips-for-writing-well/"&gt;Writing Tips from Ernest Hemingway&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Hemingway could have been giving Unix advice:&lt;br /&gt;&lt;br /&gt;Writing tips:&lt;br /&gt;&lt;br /&gt;1. Use short sentences.&lt;br /&gt;&lt;br /&gt;2. Use short paragraphs.&lt;br /&gt;&lt;br /&gt;3. Use vigorous English - make your writing forceful.&lt;br /&gt;&lt;br /&gt;4. Use positive words instead of negative ones  - i.e. software is "stable" rather than "bug-free".&lt;br /&gt;&lt;br /&gt;5. Write one page of masterpiece vs. 91 pages of garbage.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Unix Tips:&lt;br /&gt;&lt;br /&gt;1. Create small subprograms that do one function.&lt;br /&gt;&lt;br /&gt;2. Use subprograms to build a small program that does one task.&lt;br /&gt;&lt;br /&gt;3. Make use of unix pipes and powerful command-line utilities.&lt;br /&gt;&lt;br /&gt;4. Create programs that interface with other programs, instead of user interfaces.&lt;br /&gt;&lt;br /&gt;5. A one page shell script vs. many pages of C or java.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5503501353060432724?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5503501353060432724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5503501353060432724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5503501353060432724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5503501353060432724'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/unix-and-hemingway.html' title='Unix and Hemingway'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-58383326475358828</id><published>2011-03-25T01:50:00.000-05:00</published><updated>2011-03-25T01:50:12.530-05:00</updated><title type='text'>An Example of Creative Destruction Through the Internet</title><content type='html'>We are fortunate to live in a capitalist, first-world society.  But, have you ever wondered why capitalism thrives?  It's because of the concept of creative destruction.  Normally, businesses compete through razor-thin margins.  But, sometimes, a new breakthrough is made, and one company leapfrogs the rest.  The company's stock holders get rich, but the public benefits the most.&lt;br /&gt;&lt;br /&gt;The internet is revolutionizing and greatly fostering creative destruction.  That is why we have entered an era of tremendous progress.&lt;br /&gt;&lt;br /&gt;A perfect example of internet-based creative destruction is Zenni Optical - which was recently profiled in a &lt;a href="http://www.wzzm13.com/news/specials/13onyourside/158403/216/Super-Saver---Buying-glasses-online?odyssey=mod|newswell|text|FRONTPAGE|p"&gt;TV news report&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Instead of going to an store and spending hundreds of dollars on a pair of glasses, Zenni lets you buy a pair of &lt;a href="http://www.zennioptical.com"&gt;prescription eyeglasses&lt;/a&gt; from Zenni for only $11.90 a pair.&lt;br /&gt;&lt;br /&gt;All you need is your prescription and your pupilary distance.  Then, you can see a virtual pair of yourself with different eyeglasses.&lt;br /&gt;&lt;br /&gt;In the news report, they compared the quality to a pair of glasses from a local optician and found the pairs of about the same quality.&lt;br /&gt;&lt;br /&gt;So, Zenni optical might be able to save you a lot of money.&lt;br /&gt;&lt;br /&gt;This shows that a lot of the cost of eye glasses are due to high margins.  You can pay $300 or $11 for a similar pair of glasses.  The difference is that the optical shop needs the money to pay its rent, suppliers, employees, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-58383326475358828?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/58383326475358828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=58383326475358828' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/58383326475358828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/58383326475358828'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/example-of-creative-destruction-through.html' title='An Example of Creative Destruction Through the Internet'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-7782854663335084063</id><published>2011-03-24T12:51:00.001-05:00</published><updated>2011-03-25T01:53:16.039-05:00</updated><title type='text'>Comparing Python and Awk</title><content type='html'>&lt;div&gt;Python is a scripting language that is gaining popularity.&amp;nbsp; A lot of people think it is better than perl, which I think has a lot of ugly complexity to it.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;I have python installed on my unix system, and I translated the awk squares program into python.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Below I first present the original awk version, and then the python version.&amp;nbsp; They both print the numbers 1 - 10, along with their squares.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;awk version&lt;/div&gt;&lt;div&gt;-------------------------&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;#! /usr/bin/nawk -f&lt;/div&gt;&lt;div&gt;BEGIN {&lt;/div&gt;&lt;div&gt;printf ("\nSquares from 1 to 10")&lt;/div&gt;&lt;div&gt;printf ("\nNumber\tSquare\n")&lt;/div&gt;&lt;div&gt;printf ("------\t------\n")&lt;/div&gt;&lt;div&gt;for (i=1; i&amp;lt;=10; i++)&lt;/div&gt;&lt;div&gt;printf ("%d\t%d\n", i, i^2)&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;python version&lt;/div&gt;&lt;div&gt;------------------------&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;#! /usr/local/bin/python&lt;/div&gt;&lt;div&gt;print  "\nSquares from 1 to 10"&lt;/div&gt;&lt;div&gt;print "Number\tSquare"&lt;/div&gt;&lt;div&gt;print "------\t------"&lt;/div&gt;&lt;div&gt;for i in range(1,11):&lt;/div&gt;&lt;div&gt;print str(i) + "\t" + str(i**2)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The #! on the first line tells unix the location of the script interpreter to use. The python range command returns a range of integers, can can be used with the for loop.&amp;nbsp; Also note that the python print statement only prints strings, so we have to convert the numbers to strings.&amp;nbsp; Notice that python uses ** instead of ^ for raising a number to a power.&lt;/div&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-7782854663335084063?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/7782854663335084063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=7782854663335084063' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7782854663335084063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7782854663335084063'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/comparing-python-and-awk.html' title='Comparing Python and Awk'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6517834499363489732</id><published>2011-03-21T01:40:00.001-05:00</published><updated>2011-03-21T01:41:39.607-05:00</updated><title type='text'>The Importance of Monitoring Your Website</title><content type='html'>If you own a website that you depend on for business, work, or a serious hobby, then &lt;a href="http://www.1stwarning.com/"&gt;web site monitoring&lt;/a&gt; to track uptime is important.&lt;br /&gt;&lt;br /&gt;Surprisingly, some internet service providers (ISPs) are down more frequently than you would expect and are affected by even small surges in traffic.&lt;br /&gt;&lt;br /&gt;It can be a complete disaster if, for example, you are able to drive heavy traffic to your site due to a marketing promotion, but the site then crashes.&lt;br /&gt;&lt;br /&gt;In all these cases, you not only lose orders, but you build a reputation for unreliability.&lt;br /&gt;&lt;br /&gt;The solution is to use &lt;a href="http://www.1stwarning.com/"&gt;web site monitoring services&lt;/a&gt;  to track the status of your site.  It can alert you when the site is down - so that you can contact your ISP and/or switch to a backup ISP. &lt;br /&gt;&lt;br /&gt;Proactive &lt;a href="http://www.1stwarning.com/"&gt;server monitoring&lt;/a&gt; also allows you to log and track all the downtime stats - so you know when it is time to find a new ISP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6517834499363489732?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6517834499363489732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6517834499363489732' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6517834499363489732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6517834499363489732'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/importance-of-monitoring-your-website.html' title='The Importance of Monitoring Your Website'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-8173104123581091793</id><published>2011-03-21T01:07:00.001-05:00</published><updated>2011-03-21T01:07:21.864-05:00</updated><title type='text'>Awk Script For Counting Words in a File</title><content type='html'>&lt;div&gt;Here is a shell script&amp;nbsp;called &lt;em&gt;word_freq&lt;/EM&gt; that uses &lt;em&gt;awk&lt;/EM&gt; to read in a file and return the count of each word.&amp;nbsp; The script then uses &lt;em&gt;sort&lt;/EM&gt; to sort the words from highest to lowest frequency.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;For example, if you have a file consisting of:&lt;/div&gt;&lt;div&gt;&lt;font color=#007f7f&gt;every good boy does fine&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#007f7f&gt;what a good boy am I&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#007f7f&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The program will return:&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#0000bf&gt;2 good&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#0000bf&gt;2 boy&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#0000bf&gt;1 what&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#0000bf&gt;1 fine&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#0000bf&gt;1 every&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#0000bf&gt;1 does&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#0000bf&gt;1 am&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#0000bf&gt;1 a&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#0000bf&gt;1 I&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Here is the  program:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;font size=2&gt;  &lt;div&gt;&lt;font color=#bf00bf&gt;nawk '&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#bf00bf&gt;{&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#bf00bf&gt;for (i=1;i&amp;lt;=NF;i++)&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#bf00bf&gt;count[$i]++&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#bf00bf&gt;}&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#bf00bf&gt;END {&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#bf00bf&gt;for (i in count)&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#bf00bf&gt;print count[i], i&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#bf00bf&gt;}' $* |&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#bf00bf&gt;sort -r&lt;/FONT&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=#bf00bf&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The awk body is applied to each line, and it uses a for-loop to loop from 1 to NF (which is the number of fields on the line). It then uses the dollar sign to reference the contents of the field, and uses that to index an array called count.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;So, for example, on the first line, $2 is "good", so count["good"] is set to 1. when the next line is processed, $3 is  "good", so count["good"] is set to 2.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Then, after all the input is processed, the END section uses the for...in.. version of the for loop, which is used to loop thu the elements of an array.&amp;nbsp; We then print out the word count, and the word.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;In awk, when the array index is a non-numeric, the for...in loop returns the element in random order.&amp;nbsp; Thus, we pipe the output into "sort -r", which will sort the words from highest to lowest.&lt;/div&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-8173104123581091793?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/8173104123581091793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=8173104123581091793' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8173104123581091793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/8173104123581091793'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/awk-script-for-counting-words-in-file.html' title='Awk Script For Counting Words in a File'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6717079783851210821</id><published>2011-03-21T01:05:00.002-05:00</published><updated>2011-03-21T01:05:20.846-05:00</updated><title type='text'>The Unix Stream Editor (sed)</title><content type='html'>The Unix stream editor (&lt;span style="font-style: italic;"&gt;sed&lt;/span&gt;) is useful for editing streams of text.  You can either  pipe the text into &lt;span style="font-style: italic;"&gt;sed&lt;/span&gt;, or else give a file name - in which case, &lt;span style="font-style: italic;"&gt;sed&lt;/span&gt; works on the file.&lt;br /&gt;&lt;br /&gt;In all cases, &lt;span style="font-style: italic;"&gt;sed&lt;/span&gt; does not change the original text, but sends the modified text to standard out.&lt;br /&gt;&lt;br /&gt;Sure, I could just use &lt;span style="font-style: italic;"&gt;awk&lt;/span&gt; but, for some tasks, its just easier to use &lt;span style="font-style: italic;"&gt;sed&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Some examples:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;sed 4q&lt;/span&gt;    Prints the first 4 lines of the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;sed 's/yes/no/'&lt;/span&gt;   Substitute "no" for the first occurance of "yes" on each line.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;sed 's/yes/no/g'&lt;/span&gt;  In this case, substitute "no" for all occurances of "yes".&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;sed 's/yes/no/2'&lt;/span&gt;   Substitute "no" for the second occurance of "yes" on each line.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6717079783851210821?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6717079783851210821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6717079783851210821' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6717079783851210821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6717079783851210821'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/unix-stream-editor-sed.html' title='The Unix Stream Editor (sed)'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-7079832861812167953</id><published>2011-03-19T11:57:00.000-05:00</published><updated>2011-03-19T11:57:07.741-05:00</updated><title type='text'>Local Targeting is Underused With Search Marketing</title><content type='html'>If you have a website or internet business that appeals to local customers and want to advertise on Google search results using &lt;a href="http://www.phillyadwords.com"&gt;AdWords&lt;/a&gt;, your return on investment (ROI) can be much higher if you target your campaign towards a local search.  &lt;br /&gt;&lt;br /&gt;Certain keywords can narrowly target your local area, and Google allows Adwords campaigns to be geo-targeted to only show at searchers in your locale.&lt;br /&gt;&lt;br /&gt;The best way to take advantage is to hire an agency that specializes in your area.&lt;br /&gt;&lt;br /&gt;For example, if you are located in the Philadelphia area, you might want to try PhillyAdwords.com, which is a local &lt;a href="http://www.phillyadwords.com"&gt;AdWords management company&lt;/a&gt; for the Philly area.&lt;br /&gt;&lt;br /&gt;They can create a focused and targeted &lt;a href="http://www.phillyadwords.com"&gt;AdWords management&lt;/a&gt; campaign that will appeal to local customers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-7079832861812167953?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/7079832861812167953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=7079832861812167953' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7079832861812167953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/7079832861812167953'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/local-targeting-is-underused-with.html' title='Local Targeting is Underused With Search Marketing'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-3934267604217484520</id><published>2011-03-19T11:45:00.000-05:00</published><updated>2011-03-19T11:45:00.921-05:00</updated><title type='text'>Splitting Large Unix Text Files into Smaller Files</title><content type='html'>Let's say that we have a large unix file.  For example, a text file called &lt;span style="font-style:italic;"&gt;my_list&lt;/span&gt; with 100,000 lines.&lt;br /&gt;&lt;br /&gt;We need the data contained in smaller files with no more than 1000 lines each.&lt;br /&gt;&lt;br /&gt;We can use the unix &lt;span style="font-style:italic;"&gt;split&lt;/span&gt; command:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;split -1000 my_list&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will create 100 files in the current directory that each contain 1000 lines from my_list.  Since we did not specify a name for the output file, the files will be named by an &lt;span style="font-style:italic;"&gt;x&lt;/span&gt;, followed by two letters of the alphabet (from &lt;span style="font-style:italic;"&gt;aa&lt;/span&gt; to &lt;span style="font-style:italic;"&gt;zz&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;So, for example, the first 1000 lines of &lt;span style="font-style:italic;"&gt;my_list&lt;/span&gt; will be in file &lt;span style="font-style:italic;"&gt;xaa&lt;/span&gt;, the next 1000 lines in &lt;span style="font-style:italic;"&gt;xab&lt;/span&gt;, the next 1000 in &lt;span style="font-style:italic;"&gt;xac&lt;/span&gt;, etc.&lt;br /&gt;&lt;br /&gt;If we had specified an output file name like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;split -1000 my_list my_list&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then the output files would have been &lt;span style="font-style:italic;"&gt;my_listaa&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;mylistab&lt;/span&gt;, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-3934267604217484520?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/3934267604217484520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=3934267604217484520' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3934267604217484520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/3934267604217484520'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/splitting-large-unix-text-files-into.html' title='Splitting Large Unix Text Files into Smaller Files'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6310003317577608899</id><published>2011-03-19T11:43:00.001-05:00</published><updated>2011-03-19T11:43:07.155-05:00</updated><title type='text'>Awk Scripts for Compound Interest Calculations</title><content type='html'>Last year, I posted &lt;a href="http://unix-simple.blogspot.com/2006/09/two-awk-scripts-for-calculating.html"&gt;2 Awk Scripts&lt;/a&gt; for calculating compound interest.&lt;br /&gt;&lt;br /&gt;The "compound" script simply adds compound interest to an initial starting principle.&lt;br /&gt;&lt;br /&gt;The second script, "compound_add", uses the principle value as a regular contribution.  In other words, it adds in this amount each period and then calculates interest on the total.&lt;br /&gt;&lt;br /&gt;I recently created a third script, called "compound_add2".  This script combines the functionality of the 2 previous scripts.  It allows you to add a regular contribution to an account that already has principle.&lt;br /&gt;&lt;br /&gt;Here are some examples of how to use these scripts:&lt;br /&gt;&lt;br /&gt;1. You open a money market account with $5,000 and earn 0.45% / month.  How much is the account worth after 1 year?  You would use "compound 5000 .45 12"&lt;br /&gt;&lt;br /&gt;2. You open a money market account with $200, contribute $200 each month, and earn 0.45% / month.  How much is the account worth after 1 year? You would use "compound_add 200 .45 12"&lt;br /&gt;&lt;br /&gt;3. You have an existing money market account with $5,000.  You now contribute $200 each month and earn 0.45% / month. How much is the account worth after 1 year? You would use "compound_add2 5000 200 .45 12"&lt;br /&gt;&lt;br /&gt;Here is the compound_add2 script:&lt;br /&gt;&lt;br /&gt;BEGIN {&lt;br /&gt;&lt;br /&gt;if (ARGC &lt; 5)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;printf ("Usage: %s start add rate time\n",ARGV[0])&lt;br /&gt;&lt;br /&gt;exit 1&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;start=ARGV[1]&lt;br /&gt;&lt;br /&gt;add=ARGV[2]&lt;br /&gt;&lt;br /&gt;rate=ARGV[3]/100+1&lt;br /&gt;&lt;br /&gt;time=ARGV[4]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;printf ("Start with %.2f.\n",start,rate,time)&lt;br /&gt;&lt;br /&gt;printf ("Amount %.2f added in each time and compounded at %.4f for %d yields: \n\n",add,rate,time)&lt;br /&gt;&lt;br /&gt;total = start&lt;br /&gt;&lt;br /&gt;invest = start&lt;br /&gt;&lt;br /&gt;for (i=1;i&lt;=time; i++)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;total = (add + total)*rate&lt;br /&gt;&lt;br /&gt;invest += add&lt;br /&gt;&lt;br /&gt;printf ("%d: %.2f      (invested: %d)\n", i, total, invest)&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6310003317577608899?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6310003317577608899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6310003317577608899' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6310003317577608899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6310003317577608899'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/awk-scripts-for-compound-interest.html' title='Awk Scripts for Compound Interest Calculations'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4889916061449029494</id><published>2011-03-17T14:58:00.001-05:00</published><updated>2011-03-17T14:58:08.853-05:00</updated><title type='text'>Unix Search Command</title><content type='html'>Here is a script called "search" that will allow you to search through a hiearchy of directories for files that contain a word or phrase:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;echo "The pattern is found in these files:"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;find . -exec grep -il "$*" {} \;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You could type in, for example, "search green" or "search will be going".  In the first case, it will return the names of files that contain "green".  In the second case, it will return the names of files that contain the phrase "will be going".&lt;br /&gt;&lt;br /&gt;Search works because of the find command.  The unix find command searches directories recursively, and it has the -exec option, which allows you to specify a command to be run on any file that is found.&lt;br /&gt;&lt;br /&gt;The format of the -exec option is: &lt;span style="color: rgb(204, 0, 0);"&gt;-exec command options {} \;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;command&lt;/span&gt; and &lt;span style="color: rgb(204, 0, 0);"&gt;options&lt;/span&gt; are just the command name and any options.  The &lt;span style="color: rgb(204, 0, 0);"&gt;{}&lt;/span&gt; are place holders for the file name.  Find will replace them with the name of each file that it finds.  The &lt;span style="color: rgb(204, 0, 0);"&gt;\;&lt;/span&gt; is used to signify the end of the command.&lt;br /&gt;&lt;br /&gt;In this case, we are giving a grep command as the argument to the exec option.&lt;br /&gt;&lt;br /&gt;Note that search is case insensitive so "search green" would return files with "green", "Green", "GREEN", etc.&lt;br /&gt;&lt;br /&gt;For case sensitive searches, I have a script called searchcase.  The only difference in searchcase is that the "i" in the grep is removed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4889916061449029494?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4889916061449029494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4889916061449029494' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4889916061449029494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4889916061449029494'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/unix-search-command.html' title='Unix Search Command'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4299215090435965058</id><published>2011-03-17T14:56:00.002-05:00</published><updated>2011-03-17T14:56:30.230-05:00</updated><title type='text'>Generating Random Coupon Codes Through Awk</title><content type='html'>Here is an awk script I use to generate 100 random 8-character coupon codes.&lt;br /&gt;&lt;br /&gt;Each character has 62 possibilities (a-z, A-Z, and 0-9).  This means there are 8^62 possible coupon codes.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;BEGIN {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;       s="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;       srand()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;       for (i=1;i&lt;=100;i++)         {             code=""              for (j=1;j&lt;=8;j++)                 code = code""substr(s,int(rand()*62)+1,1)              print code          }        }&lt;/span&gt;   &lt;br /&gt;&lt;br /&gt;Let's analyze the script.    First, we set string &lt;span style="font-style: italic;"&gt;s&lt;/span&gt; to hold all 62 possible characters.&lt;br /&gt;&lt;br /&gt;Next, we call &lt;span style="font-style: italic;"&gt;srand()&lt;/span&gt; to seed awk's random number generator.  We left the argument blank, so that the current date is used for seeding.&lt;br /&gt;&lt;br /&gt;We now loop 100 times, because we want to output 100 coupon codes.&lt;br /&gt;&lt;br /&gt;In this loop, we first set the coupon code back to the empty string.  Then, we have an inner loop that executes 8 times to build the code.  Finally, we print the code.&lt;br /&gt;&lt;br /&gt;Notice the command in the inner loop.  This command uses the random (rand) function.  Since rand() returns a number greater or equal to 0, and less than 1, we multiply it by 62 and use the integer (int) function.&lt;br /&gt;&lt;br /&gt;This will return a number between 0 and 61.  Why?  Because int(0*62) = int(0) = 0 and int(.999...*62) = int(61.99...) = 61.&lt;br /&gt;&lt;br /&gt;We then add 1 to the result to get a random number from 1-62.  We then use this result in the substr function to randomly pick a character.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4299215090435965058?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4299215090435965058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4299215090435965058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4299215090435965058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4299215090435965058'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/generating-random-coupon-codes-through.html' title='Generating Random Coupon Codes Through Awk'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6732021334909859958</id><published>2011-03-14T01:24:00.003-05:00</published><updated>2011-03-14T01:24:55.313-05:00</updated><title type='text'>Creative Design for Trade Shows</title><content type='html'>Cleverness is not just reserved for computers.  Even in the real world, people use creative design to solve problems.&lt;br /&gt;&lt;br /&gt;For example, trade shows need booths and displays set up. It used to be, this took time.  A company had to reach the trade show location early the day before the show, so that the trade show workers could put their booths together.&lt;br /&gt;&lt;br /&gt;Now, however, there are &lt;a href="http://www.camelbackdisplays.com/popupdisplays.html"&gt;pop up booths&lt;/a&gt; and &lt;a href="http://www.camelbackdisplays.com/popupdisplays.html"&gt;pop up displays&lt;/a&gt;.  They can all be set up rather quickly: the frame opens up, then fabric or graphic panels can be hung on them.&lt;br /&gt;&lt;br /&gt;For a company at a trade show, this means that they don't have to travel to the city and venue early the day before the show.  Workers can quickly set them up.&lt;br /&gt;&lt;br /&gt;These &lt;a href="http://www.camelbackdisplays.com/popupdisplays.html"&gt;pop up trade show displays&lt;/a&gt; also give the company's flexibility.  Suppose, for example, that after the trade show starts, they realize that one of the booths need to be repositioned.  They now are able to make these adjustments easily and quickly.&lt;br /&gt;&lt;br /&gt;A &lt;a href="http://www.camelbackdisplays.com/popupdisplays.html"&gt;trade show pop up&lt;/a&gt; also enables companies to set up small exhibits outside of convention halls: for example, in stores, during festivals, at sports events, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6732021334909859958?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6732021334909859958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6732021334909859958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6732021334909859958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6732021334909859958'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/creative-design-for-trade-shows.html' title='Creative Design for Trade Shows'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6741077470570708494</id><published>2011-03-14T01:24:00.001-05:00</published><updated>2011-03-14T01:24:23.696-05:00</updated><title type='text'>Randomly Displaying Links on A Website Using JavaScript</title><content type='html'>I recently experimented with creating a javascript script that could randomly display different links on a webpage.&lt;br /&gt;&lt;br /&gt;I think this feature will come in handy for some internet marketing ideas I have in mind.&lt;br /&gt;&lt;br /&gt;Anyway, the script below generates a random number from 1 to 100.&lt;br /&gt;&lt;br /&gt;If the random number is 25 or less, it displays a link to yahoo.com.  Otherwise, it displays a link to google.com.&lt;br /&gt;&lt;br /&gt;To test this script, you simply save it in a file with an htm or html extension. Then, you just load it into Internet explorer or Firefox.&lt;br /&gt;&lt;br /&gt;Whenever you load the page, or click refresh, the browser will display the yahoo link  25% of the time, and the google link 75% of the time.&lt;br /&gt;&lt;br /&gt;&amp;lt;SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;&lt;br /&gt;//--&amp;gt;&lt;br /&gt;&lt;br /&gt;var i = Math.round(100*Math.random());&lt;br /&gt;&lt;br /&gt;if (i&lt;=25){document.write(i + ' yahoo');document.write('&amp;lt;b&amp;gt;&amp;lt;a href="http://www.yahoo.com" target="_blank"&amp;gt;Search&amp;lt;/a&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;');}if (i&gt;25)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;document.write(i + ' google');&lt;br /&gt;&lt;br /&gt;document.write('&amp;lt;b&amp;gt;&amp;lt;a href="http://www.google.com" target="_blank"&amp;gt;Search&amp;lt;/a&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;');&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6741077470570708494?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6741077470570708494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6741077470570708494' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6741077470570708494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6741077470570708494'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/randomly-displaying-links-on-website.html' title='Randomly Displaying Links on A Website Using JavaScript'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-2390502876780344859</id><published>2011-03-10T13:34:00.000-06:00</published><updated>2011-03-10T13:34:00.939-06:00</updated><title type='text'>How To Keep Travelling Costs Down</title><content type='html'>A lot of the programmers that I work with like to travel during their vacation, and see new places.  They especially like to go to places like Las Vegas, California, New York, or Florida.&lt;br /&gt;&lt;br /&gt;A lot of them search for airline tickets, hotels, and car rentals online to save money.  Expedia is an especially popular site.&lt;br /&gt;&lt;br /&gt;Well, today I learned that you can save even more from Expedia.&lt;br /&gt;&lt;br /&gt;There is a site that offers &lt;a href="http://www.deals2.com/Expedia-Coupons.htm"&gt;Expedia coupons&lt;/a&gt; that can be used for booking anything - including airline tickets, car rentals, hotels, cruises, vacation packages, etc.  This means savings on top of the savings you already get from booking online through them.&lt;br /&gt;&lt;br /&gt;All you have to do is use one of their &lt;a href="http://www.allonlinecoupons.com/st/expedia/"&gt;Expedia.com coupon code&lt;/a&gt;s after you find what you are looking for, and are ready to check out.&lt;br /&gt;&lt;br /&gt;In fact, we are thinking of traveling over my son's spring break.  Since we now also have a 2 month old son, it will get cramped traveling for 5 hours with the four of us in our Camry.  So, we are thinking of renting a van.&lt;br /&gt;&lt;br /&gt;But, we are worried about the costs of renting a van for maybe 4-5 days.  Using Expedia and an &lt;a href="http://www.bestonlinecoupons.com/coupons/expedia.asp"&gt;Expedia coupon&lt;/a&gt;, I think that we should be able to save a lot of money.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-2390502876780344859?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/2390502876780344859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=2390502876780344859' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2390502876780344859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/2390502876780344859'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/how-to-keep-travelling-costs-down.html' title='How To Keep Travelling Costs Down'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-6271863609070647506</id><published>2011-03-10T12:58:00.002-06:00</published><updated>2011-03-11T10:14:46.583-06:00</updated><title type='text'>The Powerful Unix "For" Loop</title><content type='html'>If you are working in a unix (or linux) environment, you might find the command line 'for' loop to be handy for automating different tasks.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Below are three examples of the 'for' loop.  All the commands are in italics and should be entered on the command line, followed by a carriage return.  &lt;br /&gt;Note that, after entering the initial 'for' line, you will get the secondary unix prompt, which is usually a "&gt;".&lt;br /&gt;&lt;br /&gt;1. Rename all ".old" files in the current directory to ".bak":&lt;br /&gt;&lt;pre&gt;&lt;i&gt; for i in *.old &lt;/i&gt;  &lt;br /&gt;&lt;i&gt; do &lt;/i&gt; &lt;br /&gt;&lt;i&gt; j=`echo $i|sed 's/old/bak/'` &lt;/i&gt; &lt;br /&gt;&lt;i&gt; mv $i $j &lt;/i&gt; &lt;br /&gt;&lt;i&gt; done &lt;/i&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here, we looped thru all files with extension ".old", setting the variable "i" to be the file name we are currently looping thru.  Then, between the "do" and "done", we have the body of the loop.  On each pass, we echo the file name ("i") to the unix stream editor sed.  Sed replaces the "old" with "bak" (so file "a.old" becomes "a.bak"), and saves the changed name to variable "j".  Then, we use the unix move (mv) command to rename the original file (ex. a.old) to the new file (a.bak).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Change all instances of "yes" to "no" in all ".txt" files in the current directory.  &lt;br /&gt;Back up the original files to ".bak".&lt;br /&gt;&lt;pre&gt;&lt;i&gt; for i in *.txt&lt;/i&gt;  &lt;br /&gt;&lt;i&gt; do &lt;/i&gt; &lt;br /&gt;&lt;i&gt; j=`echo $i|sed 's/txt/bak/'` &lt;/i&gt; &lt;br /&gt;&lt;i&gt; mv $i $j &lt;/i&gt; &lt;br /&gt;&lt;i&gt;  sed 's/yes/no/' $j &gt; $i &lt;/i&gt;&lt;br /&gt;&lt;i&gt; done &lt;/i&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In this case, we rename each file from ".txt" to ".bak".  Additionally, we use sed a second time, on the &lt;b&gt;contents&lt;/b&gt; of the original file (now with a ".bak" extension) and save the modified text back to the original name (with ".txt").&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3.  Loop thru a text file containing possible file names.  &lt;br /&gt;If the file is readable, print the first line, otherwise print an error message:&lt;br /&gt;&lt;pre&gt;&lt;i&gt; for i in `cat file_list.txt`&lt;/i&gt;&lt;br /&gt;&lt;i&gt; do &lt;/i&gt;&lt;br /&gt;&lt;i&gt;      if test -r $i &lt;/i&gt;&lt;br /&gt;&lt;i&gt;     then &lt;/i&gt;&lt;br /&gt;&lt;i&gt;           echo "Here is the first line of file: $i"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;           sed 1q $i&lt;/i&gt;&lt;br /&gt;&lt;i&gt;     else &lt;/i&gt;&lt;br /&gt;&lt;i&gt;         echo "file $i cannot be open for reading." &lt;/i&gt;&lt;br /&gt;&lt;i&gt;     fi&lt;/i&gt;&lt;br /&gt;&lt;i&gt;  done &lt;/i&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here, we loop thru the results of a command (in this case "cat"), rather than looping thru files in the directory.  We also use an if statement with the "test" command to test for a condition (in this case, whether the file is readable).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-6271863609070647506?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/6271863609070647506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=6271863609070647506' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6271863609070647506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/6271863609070647506'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/powerful-unix-for-loop.html' title='The Powerful Unix &quot;For&quot; Loop'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-4458409693427895812</id><published>2011-03-10T12:57:00.001-06:00</published><updated>2011-03-10T12:57:36.430-06:00</updated><title type='text'>Running Unix Commands in Parallel and Sequentially</title><content type='html'>Let's look at some ways to run unix commands on the same command prompt. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ cmd1 &amp;amp; cmd2 &amp;amp;&lt;br /&gt;&lt;br /&gt;This will run both commands in the background, in parallel.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ cmd1; cmd2&lt;br /&gt;&lt;br /&gt;This will first run cmd1, and then cmd2.&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&amp;nbsp; It is the equivalent of running&amp;nbsp;&lt;span style="font-style: italic;"&gt;&lt;/span&gt; cmd1 on the command prompt, pressing return, and then&lt;span style="font-style: italic;"&gt; &lt;/span&gt;running cmd2&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;at the next command prompt.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ cmd1 &amp;amp;&amp;amp; cmd2&lt;br /&gt;&lt;br /&gt;This will run cmd1 first.&amp;nbsp; If cmd1 runs successfully (return code 0), then cmd2 is run.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ cmd1 || cmd2&lt;br /&gt;&lt;br /&gt;This will run cmd1 first.&amp;nbsp; If cmd1 runs un-successfully (non-zero return code), then cmd2 is run.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-4458409693427895812?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/4458409693427895812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=4458409693427895812' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4458409693427895812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/4458409693427895812'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/running-unix-commands-in-parallel-and.html' title='Running Unix Commands in Parallel and Sequentially'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30111740.post-5617517624115738067</id><published>2011-03-04T02:46:00.001-06:00</published><updated>2011-03-04T13:52:47.761-06:00</updated><title type='text'>Ecommerce Partners Can Help You Build Your Online Business</title><content type='html'>A lot of people decide to start an online business - but without an &lt;a href="http://www.ecommercepartners.net/Services/Internet-Marketing/Internet-Marketing-Strategy.shtml"&gt;e-commerce marketing strategy&lt;/a&gt;. Instead, they hire a website developer to create their site.  Then, they sit back, wait, and then wonder why they aren't getting more traffic and more sales.&lt;br /&gt;&lt;br /&gt;The problem is that most web developers have an artistic background, and they create sites that are beautiful to look at, but they don't attract traffic, captivate visitors with relevant content, and tie in with the company's overall business strategy / systems.&lt;br /&gt;&lt;br /&gt;Instead of focusing on the website as an isolated piece, you would be better off implementing a complte, well-thought-out, &lt;a href="http://www.ecommercepartners.net/Services/Ecommerce-Solutions/"&gt;ecommerce solution&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If, like most businesses, you don't have this kind of experience, you can hire out to a company such as Ecommerce Partners, who don't just develop websites, but devise complete &lt;a href="http://www.ecommercepartners.net/Services/Ecommerce-Solutions/"&gt;professional ecommerce solutions&lt;/a&gt; for businesses.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30111740-5617517624115738067?l=unix-simple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-simple.blogspot.com/feeds/5617517624115738067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30111740&amp;postID=5617517624115738067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5617517624115738067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30111740/posts/default/5617517624115738067'/><link rel='alternate' type='text/html' href='http://unix-simple.blogspot.com/2011/03/ecommerce-partners-can-help-you-build.html' title='Ecommerce Partners Can Help You Build Your Online Business'/><author><name>Praveen Puri</name><uri>http://www.blogger.com/profile/11684125927076601284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://4.bp.blogspot.com/_ROGQRUf5pMM/S2tJ4YThoBI/AAAAAAAACHk/wV0Z4UIE5ZY/S220/P6140001_2.JPG'/></author><thr:total>0</thr:total></entry></feed>
