<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AmirWatad.com &#187; Bash</title>
	<atom:link href="http://www.amirwatad.com/blog/archives/category/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.amirwatad.com/blog</link>
	<description>Remember the name ;)</description>
	<lastBuildDate>Wed, 22 Sep 2010 22:04:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Bash Tip &#8211; Separate a Bash Variable From Surrounding Letters</title>
		<link>http://www.amirwatad.com/blog/archives/2010/04/24/bash-tip-separate-a-bash-variable-from-surrounding-letters/</link>
		<comments>http://www.amirwatad.com/blog/archives/2010/04/24/bash-tip-separate-a-bash-variable-from-surrounding-letters/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 22:25:05 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[TIps]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=556</guid>
		<description><![CDATA[Sometimes, you might find yourself needing to concatenate the value of a bash variable with a string. I think it&#8217;s best demonstrated with (a somewhat artificial) example: 123y=h echo $yome #won't work. will print the value of the variable &#34;yome&#34; which is a null string (since it's not set) echo ${y}ome #works. will print &#34;home&#34; [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2010/04/24/bash-tip-separate-a-bash-variable-from-surrounding-letters/">Bash Tip &#8211; Separate a Bash Variable From Surrounding Letters</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Sometimes, you might find yourself needing to concatenate the value of a bash variable with a string.<br />
I think it&#8217;s best demonstrated with (a somewhat artificial) example:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">y</span>=h<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$yome</span> <span style="color: #666666; font-style: italic;">#won't work. will print the value of the variable &quot;yome&quot; which is a null string (since it's not set)</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${y}</span>ome <span style="color: #666666; font-style: italic;">#works. will print &quot;home&quot;</span></div></td></tr></tbody></table></div>
<p>That&#8217;s it, the trick is to use the curly brackets ${var} to separate the variable from its surrounding.</p>
<p>Have fun <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' title="Bash Tip   Separate a Bash Variable From Surrounding Letters" /> </p>
<p>source: <a href="http://twitter.com/bashcookbook/statuses/2241130135">@bashcookbook</a></p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2010/04/24/bash-tip-separate-a-bash-variable-from-surrounding-letters/">Bash Tip &#8211; Separate a Bash Variable From Surrounding Letters</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Bash+Tip+%E2%80%93+Separate+a+Bash+Variable+From+Surrounding+Letters+http://bit.ly/afnBGF" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Bash Tip   Separate a Bash Variable From Surrounding Letters" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2010/04/24/bash-tip-separate-a-bash-variable-from-surrounding-letters/&amp;title=Bash+Tip+%E2%80%93+Separate+a+Bash+Variable+From+Surrounding+Letters" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Bash Tip   Separate a Bash Variable From Surrounding Letters" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2010/04/24/bash-tip-separate-a-bash-variable-from-surrounding-letters/&amp;title=Bash+Tip+%E2%80%93+Separate+a+Bash+Variable+From+Surrounding+Letters" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Bash Tip   Separate a Bash Variable From Surrounding Letters" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2010/04/24/bash-tip-separate-a-bash-variable-from-surrounding-letters/&amp;t=Bash+Tip+%E2%80%93+Separate+a+Bash+Variable+From+Surrounding+Letters" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Bash Tip   Separate a Bash Variable From Surrounding Letters" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2010/04/24/bash-tip-separate-a-bash-variable-from-surrounding-letters/&amp;title=Bash+Tip+%E2%80%93+Separate+a+Bash+Variable+From+Surrounding+Letters" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Bash Tip   Separate a Bash Variable From Surrounding Letters" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2010/04/24/bash-tip-separate-a-bash-variable-from-surrounding-letters/&amp;title=Bash+Tip+%E2%80%93+Separate+a+Bash+Variable+From+Surrounding+Letters" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Bash Tip   Separate a Bash Variable From Surrounding Letters" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2010/04/24/bash-tip-separate-a-bash-variable-from-surrounding-letters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re-Use A Bash Command With Different Parameters</title>
		<link>http://www.amirwatad.com/blog/archives/2009/09/27/re-use-a-bash-command-with-different-parameters/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/09/27/re-use-a-bash-command-with-different-parameters/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 13:00:31 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=528</guid>
		<description><![CDATA[Suppose you have typed and executed this command in your Linux shell: 1./script_a.sh 1.23 &#38;&#38; ./script_b.sh 1.23 &#38;&#38; ./script_c.sh 1.23.45 Now you want to run the same command, but with 2.34 instead of 1.23 A nice way to do it is this: 1!!:gs/1.23/2.34 Meaning, run the last command (!! is also called &#8216;bang bang&#8217;, and [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/09/27/re-use-a-bash-command-with-different-parameters/">Re-Use A Bash Command With Different Parameters</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Suppose you have typed and executed this command in your Linux shell:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">/</span>script_a.sh <span style="color: #000000;">1.23</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> .<span style="color: #000000; font-weight: bold;">/</span>script_b.sh <span style="color: #000000;">1.23</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> .<span style="color: #000000; font-weight: bold;">/</span>script_c.sh 1.23.45</div></td></tr></tbody></table></div>
<p>Now you want to run the same command, but with 2.34 instead of 1.23<br />
A nice way to do it is this:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">!!</span>:gs<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.23</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.34</span></div></td></tr></tbody></table></div>
<p>Meaning, run the last command (!! is also called &#8216;bang bang&#8217;, and it&#8217;s substituted by the last command you executed), and replace every instance of 1.23 by 2.34</p>
<p>via <a href="http://unstableme.blogspot.com/2009/06/how-to-reuse-command-in-bash-command.html">Unix Bash Scripting</a>.<br />
Have fun <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' title="Re Use A Bash Command With Different Parameters" /> </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/09/27/re-use-a-bash-command-with-different-parameters/">Re-Use A Bash Command With Different Parameters</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Re-Use+A+Bash+Command+With+Different+Parameters+http://bit.ly/1gflbo" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Re Use A Bash Command With Different Parameters" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/09/27/re-use-a-bash-command-with-different-parameters/&amp;title=Re-Use+A+Bash+Command+With+Different+Parameters" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Re Use A Bash Command With Different Parameters" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/27/re-use-a-bash-command-with-different-parameters/&amp;title=Re-Use+A+Bash+Command+With+Different+Parameters" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Re Use A Bash Command With Different Parameters" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/09/27/re-use-a-bash-command-with-different-parameters/&amp;t=Re-Use+A+Bash+Command+With+Different+Parameters" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Re Use A Bash Command With Different Parameters" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/27/re-use-a-bash-command-with-different-parameters/&amp;title=Re-Use+A+Bash+Command+With+Different+Parameters" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Re Use A Bash Command With Different Parameters" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/27/re-use-a-bash-command-with-different-parameters/&amp;title=Re-Use+A+Bash+Command+With+Different+Parameters" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Re Use A Bash Command With Different Parameters" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/09/27/re-use-a-bash-command-with-different-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trimming Bash Variables &#8211; A Summary</title>
		<link>http://www.amirwatad.com/blog/archives/2009/09/05/trimming-bash-variables-a-summary/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/09/05/trimming-bash-variables-a-summary/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 15:07:03 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=506</guid>
		<description><![CDATA[This post should summarize the subject of stripping out bash variables, we already talked about on previous posts Let&#8217;s say we have a bash variable (say x), which stores a string (say &#8220;ExExampleStringStr&#8221;) Then we can do the following manipulations: 1. 1y=${x%Str*} This will trim out the shortest match of the pattern &#8220;Str*&#8221; from the [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/09/05/trimming-bash-variables-a-summary/">Trimming Bash Variables &#8211; A Summary</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This post should summarize the subject of stripping out bash variables, we already talked about on <a title="stripping bash variables" href="http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/">previous</a> <a title="stripping bash variables" href="http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/">posts</a></p>
<p>Let&#8217;s say we have a bash variable (say x), which stores a string (say &#8220;ExExampleStringStr&#8221;)</p>
<p>Then we can do the following manipulations:</p>
<p>1.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">y</span>=<span style="color: #800000;">${x%Str*}</span></div></td></tr></tbody></table></div>
<p>
This will trim out the <strong>shortest</strong> match of the pattern &#8220;Str*&#8221; <strong>from the end</strong> of the string.<br />
Thus, y will have the value &#8220;ExExampleString&#8221;.<br />
<span id="more-506"></span><br />
2.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">y</span>=<span style="color: #800000;">${x%%Str*}</span></div></td></tr></tbody></table></div>
<p>
This will trim out the <strong>longest</strong> match of the pattern &#8220;Str*&#8221; <strong>from the end</strong> of the string.<br />
Thus, y will have the value &#8220;ExExample&#8221;.<br />
3.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">y</span>=<span style="color: #800000;">${x#*Ex}</span></div></td></tr></tbody></table></div>
<p>
This will trim out the <strong>shortest</strong> match of the pattern &#8220;*Ex&#8221; <strong>from the beginning</strong> of the string.<br />
Thus, y will have the value &#8220;ExampleStringStr&#8221;.<br />
4.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">y</span>=<span style="color: #800000;">${x##*Ex}</span></div></td></tr></tbody></table></div>
<p>
This will trim out the <strong>longest</strong> match of the pattern &#8220;*Ex&#8221; <strong>from the beginning</strong> of the string.<br />
Thus, y will have the value &#8220;ampleStringStr&#8221;. (since ExEx is the longest match of the pattern *Ex)</p>
<p>So remember:<br />
# or ## = beginning<br />
% or %% = end<br />
## or %% = longest match<br />
# or % = shortest match<br />
* is a wildcard matching &#8220;any string&#8221; (including the empty string).</p>
<p>These tips are according to <a href="http://twitter.com/bashcookbook">@bashcookbook</a>&#8216;s. I recommend following him on twitter for many useful bash tips <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' title="Trimming Bash Variables   A Summary" /> <br />
Have fun</p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/09/05/trimming-bash-variables-a-summary/">Trimming Bash Variables &#8211; A Summary</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Trimming+Bash+Variables+%E2%80%93+A+Summary+http://bit.ly/ps24J" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Trimming Bash Variables   A Summary" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/09/05/trimming-bash-variables-a-summary/&amp;title=Trimming+Bash+Variables+%E2%80%93+A+Summary" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Trimming Bash Variables   A Summary" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/05/trimming-bash-variables-a-summary/&amp;title=Trimming+Bash+Variables+%E2%80%93+A+Summary" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Trimming Bash Variables   A Summary" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/09/05/trimming-bash-variables-a-summary/&amp;t=Trimming+Bash+Variables+%E2%80%93+A+Summary" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Trimming Bash Variables   A Summary" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/05/trimming-bash-variables-a-summary/&amp;title=Trimming+Bash+Variables+%E2%80%93+A+Summary" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Trimming Bash Variables   A Summary" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/05/trimming-bash-variables-a-summary/&amp;title=Trimming+Bash+Variables+%E2%80%93+A+Summary" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Trimming Bash Variables   A Summary" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/09/05/trimming-bash-variables-a-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strip Leading Characters Off A String</title>
		<link>http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 09:05:49 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=500</guid>
		<description><![CDATA[Say you have a bash variable (say x) storing the string &#8220;MyLongString&#8221; This bash command: 1&#160; &#160; echo ${x##My} Will strip the leading string &#8220;My&#8221; off the original string. And thus the output will be: LongString via @bashcookbook --------- Note: Some RSS readers might display this post with incorrect format. View original post at AmirWatad.com [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/">Strip Leading Characters Off A String</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Say you have a bash variable (say x) storing the string &#8220;MyLongString&#8221;</p>
<p>This bash command:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${x##My}</span></div></td></tr></tbody></table></div>
<p>Will strip the leading string &#8220;My&#8221; off the original string. And thus the output will be:</p>
<blockquote><p> LongString </p>
</blockquote>
<p>via <a href="http://twitter.com/bashcookbook/status/3671425767">@bashcookbook</a></p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/">Strip Leading Characters Off A String</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Strip+Leading+Characters+Off+A+String+http://bit.ly/151Nhc" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Strip Leading Characters Off A String" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/&amp;title=Strip+Leading+Characters+Off+A+String" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Strip Leading Characters Off A String" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/&amp;title=Strip+Leading+Characters+Off+A+String" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Strip Leading Characters Off A String" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/&amp;t=Strip+Leading+Characters+Off+A+String" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Strip Leading Characters Off A String" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/&amp;title=Strip+Leading+Characters+Off+A+String" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Strip Leading Characters Off A String" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/&amp;title=Strip+Leading+Characters+Off+A+String" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Strip Leading Characters Off A String" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/09/04/strip-leading-characters-off-a-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strip the File Name Suffix off a Bash Variable</title>
		<link>http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 21:18:10 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=495</guid>
		<description><![CDATA[Suppose you have a bash variable storing a file name, say x =file.jpg You can use this substitution command in order to strip out the file suffix off the string: 1echo ${x%.*} The output will be the base name of the file without the suffix. via @bashcookbook Enjoy --------- Note: Some RSS readers might display [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/">Strip the File Name Suffix off a Bash Variable</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Suppose you have a bash variable storing a file name, say x =file.jpg</p>
<p>You can use this substitution command in order to strip out the file suffix off the string:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${x%.*}</span></div></td></tr></tbody></table></div>
<p>The output will be the base name of the file without the suffix.</p>
<p>via <a href="http://twitter.com/bashcookbook/statuses/3693291819">@bashcookbook</a></p>
<p>Enjoy <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' title="Strip the File Name Suffix off a Bash Variable" /> </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/">Strip the File Name Suffix off a Bash Variable</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Strip+the+File+Name+Suffix+off+a+Bash+Variable+http://bit.ly/SchFj" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Strip the File Name Suffix off a Bash Variable" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/&amp;title=Strip+the+File+Name+Suffix+off+a+Bash+Variable" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Strip the File Name Suffix off a Bash Variable" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/&amp;title=Strip+the+File+Name+Suffix+off+a+Bash+Variable" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Strip the File Name Suffix off a Bash Variable" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/&amp;t=Strip+the+File+Name+Suffix+off+a+Bash+Variable" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Strip the File Name Suffix off a Bash Variable" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/&amp;title=Strip+the+File+Name+Suffix+off+a+Bash+Variable" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Strip the File Name Suffix off a Bash Variable" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/&amp;title=Strip+the+File+Name+Suffix+off+a+Bash+Variable" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Strip the File Name Suffix off a Bash Variable" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/09/01/strip-the-file-name-suffix-off-a-bash-variable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Multiple Nested Directories in Linux</title>
		<link>http://www.amirwatad.com/blog/archives/2009/07/03/create-multiple-nested-directories-in-linux/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/07/03/create-multiple-nested-directories-in-linux/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 09:27:20 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=488</guid>
		<description><![CDATA[Did you know that you can create a complete directory tree with one command? Let&#8217;s start with a simple example: mkdir -p a/b/c will create this tree: `-- a `-- b `-- c And any of these: mkdir -p a/{b1,b2}/c or mkdir -p a/b{1,2}/c Will create this tree: `-- a &#124;-- b1 &#124; `-- c [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/07/03/create-multiple-nested-directories-in-linux/">Create Multiple Nested Directories in Linux</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Did you know that you can create a complete directory tree with one command?</p>
<p>Let&#8217;s start with a simple example:</p>
<blockquote><p>mkdir -p a/b/c </p></blockquote>
<p>will create this tree:</p>
<blockquote>
<pre>
`-- a
    `-- b
        `-- c
</pre>
</blockquote>
<p>And any of these:</p>
<blockquote><p>mkdir -p a/{b1,b2}/c </p></blockquote>
<p>or</p>
<blockquote><p>mkdir -p a/b{1,2}/c </p></blockquote>
<p>Will create this tree:<br />
<span id="more-488"></span></p>
<blockquote>
<pre>
`-- a
    |-- b1
    |   `-- c
    `-- b2
        `-- c
</pre>
</blockquote>
<p>And a little more complicated command:</p>
<blockquote><p>mkdir -p a/b{1,2,3/c{1,2}}/d</p></blockquote>
<p>Will create this tree:</p>
<blockquote>
<pre>
`-- a
    |-- b1
    |   `-- d
    |-- b2
    |   `-- d
    `-- b3
        |-- c1
        |   `-- d
        `-- c2
            `-- d
</pre>
</blockquote>
<p> <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' title="Create Multiple Nested Directories in Linux" /> </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/07/03/create-multiple-nested-directories-in-linux/">Create Multiple Nested Directories in Linux</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Create+Multiple+Nested+Directories+in+Linux+http://bit.ly/IhZAy" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Create Multiple Nested Directories in Linux" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/07/03/create-multiple-nested-directories-in-linux/&amp;title=Create+Multiple+Nested+Directories+in+Linux" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Create Multiple Nested Directories in Linux" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/07/03/create-multiple-nested-directories-in-linux/&amp;title=Create+Multiple+Nested+Directories+in+Linux" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Create Multiple Nested Directories in Linux" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/07/03/create-multiple-nested-directories-in-linux/&amp;t=Create+Multiple+Nested+Directories+in+Linux" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Create Multiple Nested Directories in Linux" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/07/03/create-multiple-nested-directories-in-linux/&amp;title=Create+Multiple+Nested+Directories+in+Linux" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Create Multiple Nested Directories in Linux" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/07/03/create-multiple-nested-directories-in-linux/&amp;title=Create+Multiple+Nested+Directories+in+Linux" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Create Multiple Nested Directories in Linux" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/07/03/create-multiple-nested-directories-in-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tiny Bash Functions to Convert Between Numeric Representations</title>
		<link>http://www.amirwatad.com/blog/archives/2009/06/12/tiny-bash-functions-to-convert-between-numeric-representations/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/06/12/tiny-bash-functions-to-convert-between-numeric-representations/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 15:02:20 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Command Line Interface]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=472</guid>
		<description><![CDATA[I have these functions in my aliases file. They make it easy to convert between hex, binary and decimal representations of numbers. You might find it useful. Just add these to your aliases file (imported from ~/.bashrc): 123456function h2d &#123; echo &#34;obase=10; ibase=16; $( echo &#34;$*&#34; &#124; sed -e 's/0x//g' -e 's/\([a-z]\)/\u\1/g' )&#34; &#124; bc; [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/06/12/tiny-bash-functions-to-convert-between-numeric-representations/">Tiny Bash Functions to Convert Between Numeric Representations</a></p>
]]></description>
			<content:encoded><![CDATA[<p>
I have these functions in my aliases file. They make it easy to convert between hex, binary and decimal representations of numbers. You might find it useful.
</p>
<p></p>
<p>
Just add these to your aliases file (imported from ~/.bashrc):
</p>
<p></p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> h2d <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;obase=10; ibase=16; <span style="color: #007800;">$( echo &quot;$*&quot; | sed -e 's/0x//g' -e 's/\([a-z]\)</span>/\u\1/g' )&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">bc</span>; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> h2b <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;obase=2; ibase=16; <span style="color: #007800;">$( echo &quot;$*&quot; | sed -e 's/0x//g' -e 's/\([a-z]\)</span>/\u\1/g' )&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">bc</span>; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> b2d <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;obase=10; ibase=2; &quot;</span><span style="color: #007800;">$*</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">bc</span>; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> b2h <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;0x<span style="color: #007800;">$(echo &quot;obase=16; ibase=2;&quot;$*&quot;&quot; | bc)</span>&quot;</span>; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> d2b <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;obase=2; ibase=10; &quot;</span><span style="color: #007800;">$*</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">bc</span>; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> d2h <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;0x<span style="color: #007800;">$(echo &quot;obase=16; ibase=10; &quot;$*&quot;&quot; | bc)</span>&quot;</span>; <span style="color: #7a0874; font-weight: bold;">&#125;</span></div></td></tr></tbody></table></div>
<p></p>
<p>
Now you should be able to use it like this:</p>
<blockquote><p>
h2d 0xff
</p></blockquote>
<p>The output will be 255 in this case.<br />
<br />
h2b is for &#8220;hex to binary&#8221;, the others are similar (h: hex, b: binary, d: decimal)
</p>
<p></p>
<p>
Enjoy <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' title="Tiny Bash Functions to Convert Between Numeric Representations" /> </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/06/12/tiny-bash-functions-to-convert-between-numeric-representations/">Tiny Bash Functions to Convert Between Numeric Representations</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Tiny+Bash+Functions+to+Convert+Between+Numeric+Representations+http://bit.ly/NFBb" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Tiny Bash Functions to Convert Between Numeric Representations" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/06/12/tiny-bash-functions-to-convert-between-numeric-representations/&amp;title=Tiny+Bash+Functions+to+Convert+Between+Numeric+Representations" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Tiny Bash Functions to Convert Between Numeric Representations" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/06/12/tiny-bash-functions-to-convert-between-numeric-representations/&amp;title=Tiny+Bash+Functions+to+Convert+Between+Numeric+Representations" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Tiny Bash Functions to Convert Between Numeric Representations" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/06/12/tiny-bash-functions-to-convert-between-numeric-representations/&amp;t=Tiny+Bash+Functions+to+Convert+Between+Numeric+Representations" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Tiny Bash Functions to Convert Between Numeric Representations" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/06/12/tiny-bash-functions-to-convert-between-numeric-representations/&amp;title=Tiny+Bash+Functions+to+Convert+Between+Numeric+Representations" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Tiny Bash Functions to Convert Between Numeric Representations" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/06/12/tiny-bash-functions-to-convert-between-numeric-representations/&amp;title=Tiny+Bash+Functions+to+Convert+Between+Numeric+Representations" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Tiny Bash Functions to Convert Between Numeric Representations" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/06/12/tiny-bash-functions-to-convert-between-numeric-representations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Renaming Files In Linux</title>
		<link>http://www.amirwatad.com/blog/archives/2009/05/30/renaming-files-in-linux/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/05/30/renaming-files-in-linux/#comments</comments>
		<pubDate>Fri, 29 May 2009 22:40:03 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=451</guid>
		<description><![CDATA[In a previous post, I wrote about converting strings from camelCase to undescore delimited format. In this post, we&#8217;ll do the same but for file names. We&#8217;ll use the command line program &#8220;rename&#8221; for this purpose. Here we go: 1. Convert all file names in current directory which are of the form &#8220;myFileName&#8221; or &#8220;MyFileName&#8221; [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/05/30/renaming-files-in-linux/">Renaming Files In Linux</a></p>
]]></description>
			<content:encoded><![CDATA[<p>
In a previous post, I wrote about <a href="http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/">converting strings from camelCase to undescore delimited format</a>.
</p>
<p></p>
<p>
In this post, we&#8217;ll do the same but for file names. We&#8217;ll use the command line program &#8220;rename&#8221; for this purpose.<br />
Here we go:
</p>
<p>
1. Convert all file names in current directory which are of the form &#8220;myFileName&#8221; or &#8220;MyFileName&#8221; into the form of &#8220;my_file_name&#8221;:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rename <span style="color: #ff0000;">'s/(.)([A-Z])/$1_\l$2/g'</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> rename <span style="color: #ff0000;">'s/([A-Z])/\l$1/g'</span> <span style="color: #000000; font-weight: bold;">*</span></div></td></tr></tbody></table></div>
<p>2. Convert all file names in current directory which are of the form &#8220;my_file_name&#8221; into the form &#8220;myFileName&#8221;:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rename <span style="color: #ff0000;">'s/([a-z])_([a-z])/$1\u$2/g'</span> <span style="color: #000000; font-weight: bold;">*</span></div></td></tr></tbody></table></div>
<p>3. Convert all file names in current directory which are of the form &#8220;my_file_name&#8221; into the form &#8220;MyFileName&#8221;:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rename <span style="color: #ff0000;">'s/([a-z])_([a-z])/$1\u$2/g'</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> rename <span style="color: #ff0000;">'s/^([a-z])/\u$1/g'</span> <span style="color: #000000; font-weight: bold;">*</span></div></td></tr></tbody></table></div>
</p>
<p>
Enjoy <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' title="Renaming Files In Linux" /> </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/05/30/renaming-files-in-linux/">Renaming Files In Linux</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Renaming+Files+In+Linux+http://bit.ly/myrr3" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Renaming Files In Linux" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/05/30/renaming-files-in-linux/&amp;title=Renaming+Files+In+Linux" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Renaming Files In Linux" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/05/30/renaming-files-in-linux/&amp;title=Renaming+Files+In+Linux" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Renaming Files In Linux" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/05/30/renaming-files-in-linux/&amp;t=Renaming+Files+In+Linux" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Renaming Files In Linux" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/05/30/renaming-files-in-linux/&amp;title=Renaming+Files+In+Linux" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Renaming Files In Linux" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/05/30/renaming-files-in-linux/&amp;title=Renaming+Files+In+Linux" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Renaming Files In Linux" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/05/30/renaming-files-in-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert camelCase to Underscores Using sed</title>
		<link>http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/#comments</comments>
		<pubDate>Fri, 29 May 2009 22:15:34 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=444</guid>
		<description><![CDATA[This short post deals with converting strings of the form camelCase or CamelCase into camel_case, and vice versa. These are three different popular naming conventions for variable/function/class names. Convert CamelCase or camelCase to camel_case: 1sed -e 's/\([A-Z]\)/_\l\1/g' -e 's/^_\([a-z]\)/\1/g' file.txt Convert camel_case to camelCase 1sed -e 's/_\([a-z]\)/\u\1/g' file.txt Convert camel_case to CamelCase: 1sed -e 's/_\([a-z]\)/\u\1/g' [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/">Convert camelCase to Underscores Using sed</a></p>
]]></description>
			<content:encoded><![CDATA[<p>
This short post deals with converting strings of the form camelCase or CamelCase into camel_case, and vice versa. These are three different popular naming conventions for variable/function/class names.
</p>
</p>
<p>
Convert CamelCase or camelCase to camel_case:<br />

<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/\([A-Z]\)/_\l\1/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^_\([a-z]\)/\1/g'</span> file.txt</div></td></tr></tbody></table></div>

</p>
<p>Convert camel_case to camelCase<br />

<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/_\([a-z]\)/\u\1/g'</span> file.txt</div></td></tr></tbody></table></div>

</p>
<p>Convert camel_case to CamelCase:

<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/_\([a-z]\)/\u\1/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^\([a-z]\)/\u\1/g'</span> file.txt</div></td></tr></tbody></table></div>

</p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/">Convert camelCase to Underscores Using sed</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Convert+camelCase+to+Underscores+Using+sed+http://bit.ly/VEhGh" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Convert camelCase to Underscores Using sed" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/&amp;title=Convert+camelCase+to+Underscores+Using+sed" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Convert camelCase to Underscores Using sed" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/&amp;title=Convert+camelCase+to+Underscores+Using+sed" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Convert camelCase to Underscores Using sed" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/&amp;t=Convert+camelCase+to+Underscores+Using+sed" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Convert camelCase to Underscores Using sed" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/&amp;title=Convert+camelCase+to+Underscores+Using+sed" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Convert camelCase to Underscores Using sed" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/&amp;title=Convert+camelCase+to+Underscores+Using+sed" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Convert camelCase to Underscores Using sed" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/05/30/convert-camelcase-to-underscores-using-sed/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Sed and AWK &#8211; A quick reference</title>
		<link>http://www.amirwatad.com/blog/archives/2009/05/09/sed-and-awk-a-quick-reference/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/05/09/sed-and-awk-a-quick-reference/#comments</comments>
		<pubDate>Sat, 09 May 2009 11:45:57 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[AWK]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=430</guid>
		<description><![CDATA[Sed (Stream Editor) and AWK (First letters of the surnames of its authors) are very powerful *nix tools for manipulating strings and text files. They combine the power of regular expressions with the power of a programming language for this aim. Here are two quick references for doing many operations with a one-line code of [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/05/09/sed-and-awk-a-quick-reference/">Sed and AWK &#8211; A quick reference</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Sed (Stream Editor) and AWK (First letters of the surnames of its authors) are very powerful *nix tools for manipulating strings and text files. They combine the power of <a href="http://en.wikipedia.org/wiki/Regular_expression">regular expressions</a> with the power of a programming language for this aim.<br />
Here are two quick references for doing many operations with a one-line code of sed and AWK.  (Both are by the same author &#8211; Eric Perment):<br />
<span id="more-430"></span><br />
<a href="http://sed.sourceforge.net/sed1line.txt">sed 1-line</a><br />
<a href="http://www.pement.org/awk/awk1line.txt">awk 1-line</a></p>
<p>I use these very frequently, as they cover almost anything I would want to do with text files. I loved the simple format the author has chosen to use (plain text).</p>
<p>Another great document (also by Eric Perment) is a comparison between sed and awk commands:<br />
<a href="http://www.pement.org/awk/awk_sed.txt">AWK vs. sed</a></p>
<p>Visit <a href="http://www.pement.org/">Eric&#8217;s homepage</a> to find more sources and information about sed, AWK, perl and other stuff.</p>
<p>Enjoy</p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/05/09/sed-and-awk-a-quick-reference/">Sed and AWK &#8211; A quick reference</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Sed+and+AWK+%E2%80%93+A+quick+reference+http://bit.ly/7NDgb" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Sed and AWK   A quick reference" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/05/09/sed-and-awk-a-quick-reference/&amp;title=Sed+and+AWK+%E2%80%93+A+quick+reference" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Sed and AWK   A quick reference" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/05/09/sed-and-awk-a-quick-reference/&amp;title=Sed+and+AWK+%E2%80%93+A+quick+reference" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Sed and AWK   A quick reference" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/05/09/sed-and-awk-a-quick-reference/&amp;t=Sed+and+AWK+%E2%80%93+A+quick+reference" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Sed and AWK   A quick reference" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/05/09/sed-and-awk-a-quick-reference/&amp;title=Sed+and+AWK+%E2%80%93+A+quick+reference" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Sed and AWK   A quick reference" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/05/09/sed-and-awk-a-quick-reference/&amp;title=Sed+and+AWK+%E2%80%93+A+quick+reference" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Sed and AWK   A quick reference" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/05/09/sed-and-awk-a-quick-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.344 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-05 16:09:44 -->

