<?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: Bash bracket hacking</title>
	<atom:link href="http://thesmithfam.org/blog/2009/04/11/bash-bracket-hacking/feed/" rel="self" type="application/rss+xml" />
	<link>http://thesmithfam.org/blog/2009/04/11/bash-bracket-hacking/</link>
	<description>Your blog is probably better than mine.</description>
	<lastBuildDate>Sun, 05 Feb 2012 05:18:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: TheBonsai</title>
		<link>http://thesmithfam.org/blog/2009/04/11/bash-bracket-hacking/comment-page-1/#comment-96168</link>
		<dc:creator>TheBonsai</dc:creator>
		<pubDate>Thu, 24 Dec 2009 14:03:01 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=188#comment-96168</guid>
		<description>I&#039;m sorry for the delay :)

@Dave

It&#039;s just that your external [ is fault tolerant.</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry for the delay :)</p>
<p>@Dave</p>
<p>It&#8217;s just that your external [ is fault tolerant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://thesmithfam.org/blog/2009/04/11/bash-bracket-hacking/comment-page-1/#comment-93972</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 27 Nov 2009 23:59:10 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=188#comment-93972</guid>
		<description>@TheBonsai:

I&#039;ll explain with an example:

Run this (this uses the binary, you might need /usr/bin instead of /bin on your system):

/bin/[ 42 -gt 43

And it works as expected even though it&#039;s missing the closing bracket.

Now run this (this uses the built-in):

[ 42 -gt 43
-bash: [: missing `]&#039;

The built-in wants the closing bracket, but the [ binary doesn&#039;t care.</description>
		<content:encoded><![CDATA[<p>@TheBonsai:</p>
<p>I&#8217;ll explain with an example:</p>
<p>Run this (this uses the binary, you might need /usr/bin instead of /bin on your system):</p>
<p>/bin/[ 42 -gt 43</p>
<p>And it works as expected even though it's missing the closing bracket.</p>
<p>Now run this (this uses the built-in):</p>
<p>[ 42 -gt 43<br />
-bash: [: missing `]&#8216;</p>
<p>The built-in wants the closing bracket, but the [ binary doesn&#8217;t care.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TheBonsai</title>
		<link>http://thesmithfam.org/blog/2009/04/11/bash-bracket-hacking/comment-page-1/#comment-93958</link>
		<dc:creator>TheBonsai</dc:creator>
		<pubDate>Fri, 27 Nov 2009 22:55:50 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=188#comment-93958</guid>
		<description>@Byron:

It&#039;s not a problem to disable those builtins or to explicit call the external code. Since not every shell might have them builtin, but POSIX actually requires the behaviour and the command names, they&#039;re usually present as binaries on disk (doesn&#039;t apply to binaries you can only implement as a builtin, of course, except the cd command maybe).

@Dave:

I don&#039;t really understand that. Code?</description>
		<content:encoded><![CDATA[<p>@Byron:</p>
<p>It&#8217;s not a problem to disable those builtins or to explicit call the external code. Since not every shell might have them builtin, but POSIX actually requires the behaviour and the command names, they&#8217;re usually present as binaries on disk (doesn&#8217;t apply to binaries you can only implement as a builtin, of course, except the cd command maybe).</p>
<p>@Dave:</p>
<p>I don&#8217;t really understand that. Code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harold</title>
		<link>http://thesmithfam.org/blog/2009/04/11/bash-bracket-hacking/comment-page-1/#comment-79442</link>
		<dc:creator>harold</dc:creator>
		<pubDate>Wed, 03 Jun 2009 14:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=188#comment-79442</guid>
		<description>You may also use type -P instead of which!

help type

type -a [
type -p [
type -P [

help test

see: http://codesnippets.joyent.com/posts/show/2067</description>
		<content:encoded><![CDATA[<p>You may also use type -P instead of which!</p>
<p>help type</p>
<p>type -a [<br />
type -p [<br />
type -P [</p>
<p>help test</p>
<p>see: <a href="http://codesnippets.joyent.com/posts/show/2067" rel="nofollow">http://codesnippets.joyent.com/posts/show/2067</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://thesmithfam.org/blog/2009/04/11/bash-bracket-hacking/comment-page-1/#comment-75965</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Sun, 12 Apr 2009 12:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=188#comment-75965</guid>
		<description>Ah, very nice. This makes sense, because when using &#039;[&#039; on the command line for a one-liner, you don&#039;t have to include the closing &#039;]&#039;, but in a bash script, you do. I guess that proves Byron&#039;s point.

--Dave</description>
		<content:encoded><![CDATA[<p>Ah, very nice. This makes sense, because when using &#8216;[' on the command line for a one-liner, you don't have to include the closing ']&#8216;, but in a bash script, you do. I guess that proves Byron&#8217;s point.</p>
<p>&#8211;Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Byron Clark</title>
		<link>http://thesmithfam.org/blog/2009/04/11/bash-bracket-hacking/comment-page-1/#comment-75964</link>
		<dc:creator>Byron Clark</dc:creator>
		<pubDate>Sun, 12 Apr 2009 12:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=188#comment-75964</guid>
		<description>Actually, when writing a bash script, both &#039;[&#039; and &#039;test&#039; are shell builtins so the /usr/bin versions are not used.</description>
		<content:encoded><![CDATA[<p>Actually, when writing a bash script, both &#8216;[&#8216; and &#8216;test&#8217; are shell builtins so the /usr/bin versions are not used.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

