<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: 10 Steps to Beautiful Shell Scripts</title>
	<atom:link href="http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/feed" rel="self" type="application/rss+xml" />
	<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html</link>
	<description>Learn the UNIX/Linux command line</description>
	<lastBuildDate>Mon, 06 Jun 2011 01:35:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: ark khan</title>
		<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/comment-page-1#comment-47138</link>
		<dc:creator>ark khan</dc:creator>
		<pubDate>Wed, 12 Jan 2011 20:58:12 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html#comment-47138</guid>
		<description>Just saw this and it&#039;s really helpful. Thanks!</description>
		<content:encoded><![CDATA[<p>Just saw this and it&#8217;s really helpful. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/comment-page-1#comment-38196</link>
		<dc:creator>John</dc:creator>
		<pubDate>Sun, 07 Mar 2010 12:04:11 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html#comment-38196</guid>
		<description>This is excellent information. Thanks!!

I&#039;ve been using the following Linux Gazette article (in the link below) for years for its info and examples. This blog&#039;s info adds more meat to make my scripting life easier. Thanks again!!!

http://linuxgazette.net/issue18/bash.html

bash String Manipulations
By Jim Dennis, jimd@starshine.org
Linux Gazette, June 1997

NOTE: Really good info and examples of parameter substitution in this article, particularly when used in for loops for renaming, copying, and backup files.</description>
		<content:encoded><![CDATA[<p>This is excellent information. Thanks!!</p>
<p>I&#8217;ve been using the following Linux Gazette article (in the link below) for years for its info and examples. This blog&#8217;s info adds more meat to make my scripting life easier. Thanks again!!!</p>
<p><a href="http://linuxgazette.net/issue18/bash.html" rel="nofollow">http://linuxgazette.net/issue18/bash.html</a></p>
<p>bash String Manipulations<br />
By Jim Dennis, <a href="mailto:jimd@starshine.org">jimd@starshine.org</a><br />
Linux Gazette, June 1997</p>
<p>NOTE: Really good info and examples of parameter substitution in this article, particularly when used in for loops for renaming, copying, and backup files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rahul benegal</title>
		<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/comment-page-1#comment-35226</link>
		<dc:creator>rahul benegal</dc:creator>
		<pubDate>Sun, 27 Dec 2009 06:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html#comment-35226</guid>
		<description>I&#039;ve tried using the &quot;strip pattern&quot; that bash provides but i find it is :
1. hard to remember
2. often leads to unexpected results
3. not portable
4. hard to maintain - you come back a month later and can&#039;t figure out what was meant.

In many cases, `expr` is more intuitive and readable.

I&#039;d still rather trim spaces with something like:

sed &#039;s/ *$//g&#039; than it&#039;s internal equivalent that i can never remember.

A nice alternative to cut is using set, but I am not sure how portable this is.

str=&quot;abc:def:fgh:xyz&quot;
IFS=&#039;:&#039;
set -- $str
name=$1
address=$2
etc...</description>
		<content:encoded><![CDATA[<p>I&#8217;ve tried using the &#8220;strip pattern&#8221; that bash provides but i find it is :<br />
1. hard to remember<br />
2. often leads to unexpected results<br />
3. not portable<br />
4. hard to maintain &#8211; you come back a month later and can&#8217;t figure out what was meant.</p>
<p>In many cases, `expr` is more intuitive and readable.</p>
<p>I&#8217;d still rather trim spaces with something like:</p>
<p>sed &#8216;s/ *$//g&#8217; than it&#8217;s internal equivalent that i can never remember.</p>
<p>A nice alternative to cut is using set, but I am not sure how portable this is.</p>
<p>str=&#8221;abc:def:fgh:xyz&#8221;<br />
IFS=&#8217;:&#8217;<br />
set &#8212; $str<br />
name=$1<br />
address=$2<br />
etc&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bun</title>
		<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/comment-page-1#comment-33387</link>
		<dc:creator>bun</dc:creator>
		<pubDate>Wed, 11 Nov 2009 03:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html#comment-33387</guid>
		<description>$ param subs power actually comes from the ability to conclude what a param sub logically means:
v=kania; echo ${v:${#v}-1:1}
- see that ${#v}-1 is evaluated as num judging from the context, it may be specified as $((${#v}-1)) &amp; ${#v}-1 is eval&#039;ed before doing the subs
$ when u mixed with extglob, u can do like ${v#@(?[^ae])} to del a pattern in the beginning of v if it&#039;s a char followed any except a/e

$ but as deepankar implicitly point out the pattern used doesn&#039;t offer specific num of repetition, like regex&#039;s {n,m}. thus there&#039;s no way to extract &quot;abc&#124;def1&#124;ghi2&#124;jkl3&#124;mno4&#124;pqr5&#124;stu6&#124;vwx7&quot; in 1 stmt, a way is (v containing the data): v1=${v#*&#124;*&#124;*&#124;*&#124;}; v1=${v1%%&#124;*}, note the first stmt that the pattern is static &amp; the result needs to be saved to a var since those operators operate on var / not val</description>
		<content:encoded><![CDATA[<p>$ param subs power actually comes from the ability to conclude what a param sub logically means:<br />
v=kania; echo ${v:${#v}-1:1}<br />
- see that ${#v}-1 is evaluated as num judging from the context, it may be specified as $((${#v}-1)) &amp; ${#v}-1 is eval&#8217;ed before doing the subs<br />
$ when u mixed with extglob, u can do like ${v#@(?[^ae])} to del a pattern in the beginning of v if it&#8217;s a char followed any except a/e</p>
<p>$ but as deepankar implicitly point out the pattern used doesn&#8217;t offer specific num of repetition, like regex&#8217;s {n,m}. thus there&#8217;s no way to extract &#8220;abc|def1|ghi2|jkl3|mno4|pqr5|stu6|vwx7&#8243; in 1 stmt, a way is (v containing the data): v1=${v#*|*|*|*|}; v1=${v1%%|*}, note the first stmt that the pattern is static &amp; the result needs to be saved to a var since those operators operate on var / not val</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samba</title>
		<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/comment-page-1#comment-30252</link>
		<dc:creator>Samba</dc:creator>
		<pubDate>Thu, 30 Apr 2009 04:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html#comment-30252</guid>
		<description>It is really helpful, thanks a lot</description>
		<content:encoded><![CDATA[<p>It is really helpful, thanks a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Being Greedy With Bash</title>
		<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/comment-page-1#comment-26823</link>
		<dc:creator>Being Greedy With Bash</dc:creator>
		<pubDate>Fri, 09 Jan 2009 21:56:07 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html#comment-26823</guid>
		<description>[...] cannot search Google for special characters, I Googled &#8220;Bash greedy&#8221; and luckily found 10 Steps to Beautiful Shell Scripts, which just so happened to contain the technique I was looking for [...]</description>
		<content:encoded><![CDATA[<p>[...] cannot search Google for special characters, I Googled &#8220;Bash greedy&#8221; and luckily found 10 Steps to Beautiful Shell Scripts, which just so happened to contain the technique I was looking for [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pitsch</title>
		<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/comment-page-1#comment-23779</link>
		<dc:creator>pitsch</dc:creator>
		<pubDate>Mon, 03 Nov 2008 17:51:55 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html#comment-23779</guid>
		<description>&gt; “true /bin/sh”
In BusyBox v1.1.3 examples 1,2,5 are working.</description>
		<content:encoded><![CDATA[<p>&gt; “true /bin/sh”<br />
In BusyBox v1.1.3 examples 1,2,5 are working.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: de.straba.us &#187; Blog Archive &#187; Bash shell in 30&#8243;</title>
		<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/comment-page-1#comment-20639</link>
		<dc:creator>de.straba.us &#187; Blog Archive &#187; Bash shell in 30&#8243;</dc:creator>
		<pubDate>Tue, 19 Aug 2008 15:56:26 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html#comment-20639</guid>
		<description>[...] http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html" rel="nofollow">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deepankar</title>
		<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/comment-page-1#comment-17771</link>
		<dc:creator>Deepankar</dc:creator>
		<pubDate>Tue, 22 Jul 2008 09:34:14 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html#comment-17771</guid>
		<description>What if we have a long record with all fiels as pipe seperated?
eg:
abc&#124;def1&#124;ghi2&#124;jkl3&#124;mno4&#124;pqr5&#124;stu6&#124;vwx7

Here if i need to extract the 5th field, is there a way to do this using parameter substitution in a variable (supposing I initialize the variable with the content of the record mentioned above?

Any way this was a nice thing to learn and it will take some time to master it.

regards</description>
		<content:encoded><![CDATA[<p>What if we have a long record with all fiels as pipe seperated?<br />
eg:<br />
abc|def1|ghi2|jkl3|mno4|pqr5|stu6|vwx7</p>
<p>Here if i need to extract the 5th field, is there a way to do this using parameter substitution in a variable (supposing I initialize the variable with the content of the record mentioned above?</p>
<p>Any way this was a nice thing to learn and it will take some time to master it.</p>
<p>regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karthik</title>
		<link>http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html/comment-page-1#comment-17756</link>
		<dc:creator>Karthik</dc:creator>
		<pubDate>Tue, 22 Jul 2008 07:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/10-steps-to-beautiful-shell-scripts.html#comment-17756</guid>
		<description>Thanks! I was trying to understand a shell script which was written by an expert and he had extensively used these things. Searched a lot and finally got ur article.  I can understand the script easily now.

Thanks once again
Karthik</description>
		<content:encoded><![CDATA[<p>Thanks! I was trying to understand a shell script which was written by an expert and he had extensively used these things. Searched a lot and finally got ur article.  I can understand the script easily now.</p>
<p>Thanks once again<br />
Karthik</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.214 seconds -->
<!-- Cached page served by WP-Cache -->

