<?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: 18 Useful bash scripts for web developers</title>
	<atom:link href="http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/</link>
	<description></description>
	<lastBuildDate>Sun, 05 Sep 2010 16:20:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nevyn</title>
		<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/comment-page-1/#comment-15517</link>
		<dc:creator>Nevyn</dc:creator>
		<pubDate>Sun, 05 Sep 2010 16:20:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emson.co.uk/?p=58#comment-15517</guid>
		<description>&lt;p&gt;[ -d &quot;/var/cache/git&quot; ] &#124;&#124; mkdir /var/cache/git&lt;/p&gt;

&lt;p&gt;I recommend using &quot;mkdir -p&quot; instead - in your example, if /var or /var/cache were missing it would create these parts of the path too, otherwise your command might fail...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[ -d "/var/cache/git" ] || mkdir /var/cache/git</p>

<p>I recommend using &#8220;mkdir -p&#8221; instead &#8211; in your example, if /var or /var/cache were missing it would create these parts of the path too, otherwise your command might fail&#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: uhafeez</title>
		<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/comment-page-1/#comment-14546</link>
		<dc:creator>uhafeez</dc:creator>
		<pubDate>Sat, 22 May 2010 20:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emson.co.uk/?p=58#comment-14546</guid>
		<description>&lt;p&gt;This line still tries to create the directory despite its existance (giving an error saying that the directory exists)&lt;/p&gt;

&lt;p&gt;[ -d &quot;/var/cache/git&quot; ] &#124;&#124; mkdir /var/cache/git&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This line still tries to create the directory despite its existance (giving an error saying that the directory exists)</p>

<p>[ -d "/var/cache/git" ] || mkdir /var/cache/git</p>]]></content:encoded>
	</item>
	<item>
		<title>By: bash scripts - StartTags.com</title>
		<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/comment-page-1/#comment-12824</link>
		<dc:creator>bash scripts - StartTags.com</dc:creator>
		<pubDate>Fri, 29 Jan 2010 00:49:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emson.co.uk/?p=58#comment-12824</guid>
		<description>&lt;p&gt;[...] : Advanced Bash-Scripting Guide LearningBash-Scripting: Advanced Bash-Scripting Guide Learningemson... 18 Useful bash scripts for web developersUsing bash scripts to become a more efficient web developer ... Finally if you have any useful [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] : Advanced Bash-Scripting Guide LearningBash-Scripting: Advanced Bash-Scripting Guide Learningemson&#8230; 18 Useful bash scripts for web developersUsing bash scripts to become a more efficient web developer &#8230; Finally if you have any useful [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eclecti.ca &#187; Blog Archive &#187; linkHive For Jan 18th</title>
		<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/comment-page-1/#comment-12557</link>
		<dc:creator>Eclecti.ca &#187; Blog Archive &#187; linkHive For Jan 18th</dc:creator>
		<pubDate>Tue, 19 Jan 2010 16:01:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emson.co.uk/?p=58#comment-12557</guid>
		<description>&lt;p&gt;[...] emson&#8230; &#187; 18 Useful bash scripts for web developers &#8211; Here are a few scripts, that I find really useful for speeding up my web development time. [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] emson&hellip; &raquo; 18 Useful bash scripts for web developers &#8211; Here are a few scripts, that I find really useful for speeding up my web development time. [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: raggi</title>
		<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/comment-page-1/#comment-12541</link>
		<dc:creator>raggi</dc:creator>
		<pubDate>Mon, 18 Jan 2010 15:10:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emson.co.uk/?p=58#comment-12541</guid>
		<description>&lt;p&gt;Here are some points on the semantics&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;ls &#124; grep -e .&lt;em&gt;5.&lt;/em&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.&lt;em&gt;5.&lt;/em&gt;&lt;/code&gt; gets expanded inline, -unless- it fails to match&lt;/p&gt;

&lt;p&gt;When using test(1) without then, as a course of proper style, I prefer to use test rather than [. This leads to better lines IMO:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;test -e $DIR &amp;&amp; echo &#039;true&#039; &#124;&#124; echo &#039;false&#039;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;which is simply the same semantic as:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;if [ -e $DIR ]; then echo &#039;true&#039;; else echo &#039;false&#039;; fi&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;which interestingly, could be written:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;if test -e $DIR; then echo &#039;true&#039;; else echo &#039;false&#039;; fi&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;[ is not known as a test, [ &lt;em&gt;is&lt;/em&gt; test(1).
less(1) is more(1), and so on.&lt;/p&gt;

&lt;p&gt;if, then, else, and fi are bash(1) special, and in most sh(1) implementations, actually sh(1) special too.&lt;/p&gt;

&lt;p&gt;Instead of always writing echo &#039;yes&#039; and so on, you could make an alias or a command, called &#039;h&#039; (for &#039;human&#039;) or some such) which takes an exit status, and outputs a human oriented value, e.g.&lt;/p&gt;

&lt;p&gt;test -e $DIR; h # =&gt; &#039;YES&#039;&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;alias h=&#039;v=$?; if [ $v -eq 0 ]; then echo YES; else if [ $v -eq 1 ]; then echo NO; else echo ERR; fi; fi&#039;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;&quot;(xargs passes each line as an argument into EACH touch)&quot;&lt;/p&gt;

&lt;p&gt;on the contrary, xargs by default appends all line separated arguments to a single call to it&#039;s given command line.&lt;/p&gt;

&lt;p&gt;The xargs from a text file example could simply be re-written:&lt;/p&gt;

&lt;p&gt;touch &lt;code&gt;cat my_file_list.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;People often start using xargs where they don&#039;t need to...&lt;/p&gt;

&lt;p&gt;replacing spaces in file names:&lt;/p&gt;

&lt;p&gt;for i in *&#92; *; do mv $i ${i// /_}; done&lt;/p&gt;

&lt;p&gt;As far as echo&#039;s -e argument being undocumented goes, well, that&#039;s not true, if you read the manpage for echo(1) on most systems, it&#039;ll say:&lt;/p&gt;

&lt;p&gt;&quot;Some shells may provide a builtin echo command which is similar or identical to this util-ity.&quot;&lt;/p&gt;

&lt;p&gt;And find(1) has an -exec argument.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Here are some points on the semantics</p>

<p><pre>ls | grep -e .<em>5.</em></pre></p>

<p><code>.<em>5.</em></code> gets expanded inline, -unless- it fails to match</p>

<p>When using test(1) without then, as a course of proper style, I prefer to use test rather than [. This leads to better lines IMO:</p>

<p><pre>test -e $DIR &amp;&amp; echo 'true' || echo 'false'</pre></p>

<p>which is simply the same semantic as:</p>

<p><pre>if [ -e $DIR ]; then echo &#8216;true&#8217;; else echo &#8216;false&#8217;; fi</pre></p>

<p>which interestingly, could be written:</p>

<p><pre>if test -e $DIR; then echo 'true'; else echo 'false'; fi</pre></p>

<p>[ is not known as a test, [ <em>is</em> test(1).
less(1) is more(1), and so on.</p>

<p>if, then, else, and fi are bash(1) special, and in most sh(1) implementations, actually sh(1) special too.</p>

<p>Instead of always writing echo 'yes' and so on, you could make an alias or a command, called 'h' (for 'human') or some such) which takes an exit status, and outputs a human oriented value, e.g.</p>

<p>test -e $DIR; h # =&gt; 'YES'</p>

<p><pre>alias h='v=$?; if [ $v -eq 0 ]; then echo YES; else if [ $v -eq 1 ]; then echo NO; else echo ERR; fi; fi'</pre></p>

<p>"(xargs passes each line as an argument into EACH touch)"</p>

<p>on the contrary, xargs by default appends all line separated arguments to a single call to it's given command line.</p>

<p>The xargs from a text file example could simply be re-written:</p>

<p>touch <code>cat my_file_list.txt</code></p>

<p>People often start using xargs where they don't need to...</p>

<p>replacing spaces in file names:</p>

<p>for i in *&#92; *; do mv $i ${i// /_}; done</p>

<p>As far as echo's -e argument being undocumented goes, well, that's not true, if you read the manpage for echo(1) on most systems, it'll say:</p>

<p>"Some shells may provide a builtin echo command which is similar or identical to this util-ity."</p>

<p>And find(1) has an -exec argument.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Kristin33</title>
		<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/comment-page-1/#comment-12391</link>
		<dc:creator>Kristin33</dc:creator>
		<pubDate>Wed, 13 Jan 2010 00:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emson.co.uk/?p=58#comment-12391</guid>
		<description>&lt;p&gt;This fact related to this topic seems to be hot! Hence people do not should compose the &lt;a href=&quot;http://www.topthesis.com&quot; rel=&quot;nofollow&quot;&gt;thesis writing&lt;/a&gt; or just thesis proposal by their own efforts, they will use your help.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This fact related to this topic seems to be hot! Hence people do not should compose the <a href="http://www.topthesis.com" rel="nofollow">thesis writing</a> or just thesis proposal by their own efforts, they will use your help.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: leen</title>
		<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/comment-page-1/#comment-10745</link>
		<dc:creator>leen</dc:creator>
		<pubDate>Fri, 06 Nov 2009 09:37:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emson.co.uk/?p=58#comment-10745</guid>
		<description>&lt;p&gt;+1 for Metapundit .. Use rename instead of all those ocward for.. in ... mv&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>+1 for Metapundit .. Use rename instead of all those ocward for.. in &#8230; mv</p>]]></content:encoded>
	</item>
	<item>
		<title>By: diggdirect.com</title>
		<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/comment-page-1/#comment-10218</link>
		<dc:creator>diggdirect.com</dc:creator>
		<pubDate>Wed, 21 Oct 2009 05:32:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emson.co.uk/?p=58#comment-10218</guid>
		<description>&lt;p&gt;&lt;strong&gt;18 Useful bash scripts for web developers ...&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Visit Emson.co.uk for having useful tips on bash scripts for web developers.
...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><strong>18 Useful bash scripts for web developers &#8230;</strong></p>

<p>Visit Emson.co.uk for having useful tips on bash scripts for web developers.
&#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mockery Blog &#8212; A couple of useful links regarding shell scripting</title>
		<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/comment-page-1/#comment-10180</link>
		<dc:creator>Mockery Blog &#8212; A couple of useful links regarding shell scripting</dc:creator>
		<pubDate>Sun, 18 Oct 2009 14:39:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emson.co.uk/?p=58#comment-10180</guid>
		<description>&lt;p&gt;[...] http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/ [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/" rel="nofollow">http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/</a> [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Jones</title>
		<link>http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/comment-page-1/#comment-10053</link>
		<dc:creator>Craig Jones</dc:creator>
		<pubDate>Mon, 12 Oct 2009 05:38:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.emson.co.uk/?p=58#comment-10053</guid>
		<description>&lt;p&gt;Thanks for adding your colleague&#039;s &quot;Script function for .bash_profile to cd to the last opened finder location&quot; to the end of this article.   It works great, except that I had to first remove an extraneous &quot;EOT&quot; after the &quot;end tell&quot;.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for adding your colleague&#8217;s &#8220;Script function for .bash_profile to cd to the last opened finder location&#8221; to the end of this article.   It works great, except that I had to first remove an extraneous &#8220;EOT&#8221; after the &#8220;end tell&#8221;.</p>]]></content:encoded>
	</item>
</channel>
</rss>
