<?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>jaux.net &#187; Notes</title>
	<atom:link href="http://jaux.net/category/notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://jaux.net</link>
	<description></description>
	<lastBuildDate>Tue, 22 Jun 2010 04:15:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>&#8220;&#8211;&#8221; (Double-hyphen) in Bash</title>
		<link>http://jaux.net/2009/11/24/double-hyphen-in-bash/</link>
		<comments>http://jaux.net/2009/11/24/double-hyphen-in-bash/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 19:09:13 +0000</pubDate>
		<dc:creator>jaux</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://jaux.net/?p=335</guid>
		<description><![CDATA[$cat out if [ $# -eq 0 ] then echo &#34;Usage: out [-v] filenames...&#34; 1&#62;&#38;2 exit 1 fi if [ &#34;$1&#34; = &#34;-v&#34; ] then shift less -- &#34;$@&#34; else cat -- &#34;$@&#34; fi In out the -- arguments to &#8230; <a href="http://jaux.net/2009/11/24/double-hyphen-in-bash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<pre class="brush: bash;">
$cat out
if [ $# -eq 0 ]
    then
        echo &quot;Usage: out [-v] filenames...&quot; 1&gt;&amp;2
        exit 1
fi
if [ &quot;$1&quot; = &quot;-v&quot; ]
    then
        shift
        less -- &quot;$@&quot;
    else
        cat -- &quot;$@&quot;
fi
</pre>
<blockquote>
<p>In out the <code>--</code> arguments to cat and less tells these utilities that no more options follow on the command line and not to consider leading hyphen (-) in the following list as indicating options. Thus <code>--</code> allows you to view a file with a name that starts with a hyphen&#8230; <code>--</code> argument works with all Linux utilities that use the getopts builtin&#8230; This argument is particularly useful when used in conjunction with rm to remove a file whose name starts with a hyphen (<code>rm -- -fname</code>)&#8230;</p>
</blockquote>
<p><em>A Practical Guide to Linux Commands, Editors and Shell Programming (p. 442)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jaux.net/2009/11/24/double-hyphen-in-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
