<?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>.zugiart &#187; bash</title>
	<atom:link href="http://www.zugiart.com/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zugiart.com</link>
	<description>Software Engineering, buddhism, and everything else in between.</description>
	<lastBuildDate>Mon, 09 Jan 2012 05:50:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Bash: the peril of $10 args</title>
		<link>http://www.zugiart.com/2009/09/bash-args-10-issue/</link>
		<comments>http://www.zugiart.com/2009/09/bash-args-10-issue/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 03:51:11 +0000</pubDate>
		<dc:creator>zen</dc:creator>
				<category><![CDATA[geeky]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://www.zugiart.com/?p=551</guid>
		<description><![CDATA[In BASH, you need to use parenthesis when using numbered arg that exceeds 9.]]></description>
			<content:encoded><![CDATA[<p>Bash command arguments only goes up to $9. For the 10th arguments, ${10} should be used, instead of $10.</p>
<p>Example: <strong>tenthargs.sh</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$1 $2 $3 $4 $5 $6 $7 $8 $9 <span style="color: #007800;">${10}</span>&quot;</span></pre></div></div>

<p>When invoked:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>tenthargs.sh one two three four five six seven eight nine ten
<span style="color: #666666; font-style: italic;"># properly prints out:</span>
<span style="color: #666666; font-style: italic;"># one two three four five six seven eight nine ten</span></pre></div></div>

<p>if $10 is used instead of ${10}, upon running the result will be like this instead:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># one two three four five six seven eight nine one0</span></pre></div></div>

<p>That is, bash understood $10 as the first parameter ($1) followed by a literal 0 instead of the &#8216;tenth args&#8217;.</p>
<p>Of course, I have added this to my <a href="/notes/bash">bash notes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zugiart.com/2009/09/bash-args-10-issue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

