<?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: Introduction to Bash Scripting</title>
	<atom:link href="http://tipsfor.us/2008/12/09/introduction-to-bash-scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://tipsfor.us/2008/12/09/introduction-to-bash-scripting/</link>
	<description>Tech Tips, Reviews, Tutorials, Occasional Rants</description>
	<lastBuildDate>Sat, 28 Aug 2010 20:59:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Everett - TipsFor.us</title>
		<link>http://tipsfor.us/2008/12/09/introduction-to-bash-scripting/comment-page-1/#comment-5074</link>
		<dc:creator>Everett - TipsFor.us</dc:creator>
		<pubDate>Sat, 21 Feb 2009 06:05:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.tipsfor.us/?p=1250#comment-5074</guid>
		<description>Here&#039;s another little recipe to prompt for a y/n continue type thing:

echo &quot;Are you sure you want to continue? (y/n)&quot;
read a
if [[ $a != [Yy] ]]; then
    echo &quot;Exiting.&quot;
    exit;
fi</description>
		<content:encoded><![CDATA[<p>Here&#8217;s another little recipe to prompt for a y/n continue type thing:</p>
<p>echo &#8220;Are you sure you want to continue? (y/n)&#8221;<br />
read a<br />
if [[ $a != [Yy] ]]; then<br />
    echo &#8220;Exiting.&#8221;<br />
    exit;<br />
fi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Everett - TipsFor.us</title>
		<link>http://tipsfor.us/2008/12/09/introduction-to-bash-scripting/comment-page-1/#comment-4773</link>
		<dc:creator>Everett - TipsFor.us</dc:creator>
		<pubDate>Wed, 17 Dec 2008 22:42:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.tipsfor.us/?p=1250#comment-4773</guid>
		<description>I found another pitfall... on CentOS at least, you can&#039;t declare an array using the context listed in that article!!  In bash, there really AREN&#039;T arrays... you simply treat a string as an array.  E.g.

MY_ARRAY=&#039;1 2 3 4 5&#039;;

This can be tricky if there are file names with spaces involved...</description>
		<content:encoded><![CDATA[<p>I found another pitfall&#8230; on CentOS at least, you can&#8217;t declare an array using the context listed in that article!!  In bash, there really AREN&#8217;T arrays&#8230; you simply treat a string as an array.  E.g.</p>
<p>MY_ARRAY=&#8217;1 2 3 4 5&#8242;;</p>
<p>This can be tricky if there are file names with spaces involved&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Everett - TipsFor.us</title>
		<link>http://tipsfor.us/2008/12/09/introduction-to-bash-scripting/comment-page-1/#comment-4686</link>
		<dc:creator>Everett - TipsFor.us</dc:creator>
		<pubDate>Wed, 10 Dec 2008 19:06:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.tipsfor.us/?p=1250#comment-4686</guid>
		<description>One other thing that the tutorial didn&#039;t mention was error checking in bash scripts.  In bash, the $? variable contains the last returned value from a command; it goes to a non-zero number if it errors.

command
if [ $? -ne 0]; then echo &quot;command failed&quot;; exit 1; fi 

could be replaced with

command &#124;&#124; { echo &quot;command failed&quot;; exit 1; } 

Have a look at this link for more info:
&lt;a href=&quot;http://www.davidpashley.com/articles/writing-robust-shell-scripts.html&quot; rel=&quot;nofollow&quot;&gt;http://www.davidpashley.com/articles/writing-robust-shell-scripts.html&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>One other thing that the tutorial didn&#8217;t mention was error checking in bash scripts.  In bash, the $? variable contains the last returned value from a command; it goes to a non-zero number if it errors.</p>
<p>command<br />
if [ $? -ne 0]; then echo &#8220;command failed&#8221;; exit 1; fi </p>
<p>could be replaced with</p>
<p>command || { echo &#8220;command failed&#8221;; exit 1; } </p>
<p>Have a look at this link for more info:<br />
<a href="http://www.davidpashley.com/articles/writing-robust-shell-scripts.html" rel="nofollow">http://www.davidpashley.com/articles/writing-robust-shell-scripts.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->