<?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>LEXO &#124; We don't learn for the school, we learn for life. &#187; BASH</title>
	<atom:link href="http://lexo.lx-networks.net/category/programming/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://lexo.lx-networks.net</link>
	<description>Juan José Vaca Vadillo :: Non scholae, sed vitae discimus</description>
	<lastBuildDate>Tue, 20 Jul 2010 15:42:53 +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>BASH inter field separator (IFS)</title>
		<link>http://lexo.lx-networks.net/2010/07/15/bash-inter-field-separator-ifs/</link>
		<comments>http://lexo.lx-networks.net/2010/07/15/bash-inter-field-separator-ifs/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 22:03:30 +0000</pubDate>
		<dc:creator>lexo</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lexo.lx-networks.net/?p=1275</guid>
		<description><![CDATA[Example: export IFS=$'\n' for i in $(find .); do echo LEXO$i done It work better for me under GNU/Linux Slackware, but is reported that under GNU/Linux Ubuntu it doesn&#8217;t work and the change for it is: Example: export IFS=$' ' # in the second line, generating the newline for i in $(find .); do echo [...]]]></description>
			<content:encoded><![CDATA[<p>Example:</p>
<p><code>export IFS=$'\n'</p>
<p>for i in $(find .);<br />
do<br />
    echo LEXO$i<br />
done</code></p>
<p>It work better for me under GNU/Linux Slackware, but is reported that under GNU/Linux Ubuntu it doesn&#8217;t work and the change for it is:</p>
<p>Example:</p>
<p><code>export IFS=$'<br />
' # in the second line, generating the newline</p>
<p>for i in $(find .);<br />
do<br />
    echo LEXO$i<br />
done</code></p>
<p>We can use hexadecimal too:</p>
<p>IFS=$&#8217;\x20&#8242; # Space<br />
IFS=$&#8217;\x09&#8242; # Tab<br />
IFS=$&#8217;\x0A&#8217; # Line Feed<br />
IFS=$&#8217;\x0D&#8217; # Carriage Return</p>
<p>Source:<br />
<a href="http://tldp.org/LDP/abs/html/internalvariables.html">http://tldp.org/LDP/abs/html/internalvariables.html</a><br />
<a href="http://wikiri.upc.es/index.php/BASH_uso_IFS">http://wikiri.upc.es/index.php/BASH_uso_IFS</a><br />
<a href="http://forum.soft32.com/linux2/Bug-409179-DASH-Settings-IFS-work-properly-ftopict70039.html">http://forum.soft32.com/linux2/Bug-409179-DASH-Settings-IFS-work-properly-ftopict70039.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lexo.lx-networks.net/2010/07/15/bash-inter-field-separator-ifs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BASH I/O stdout, stdin, and stderr</title>
		<link>http://lexo.lx-networks.net/2009/04/28/bash-io-stdout-stdin-and-stderr/</link>
		<comments>http://lexo.lx-networks.net/2009/04/28/bash-io-stdout-stdin-and-stderr/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 21:59:47 +0000</pubDate>
		<dc:creator>lexo</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lexo.lx-networks.net/?p=683</guid>
		<description><![CDATA[Some times we don&#8217;t want that command print out messages, and we need to clean all out messages (error or standard out) that it generates. For to solve this, we are going to use the I/O facility provided by BASH. BASH provide 3 file descriptors, and they are: 0 &#8211; stdin &#8211; Used for get [...]]]></description>
			<content:encoded><![CDATA[<p>Some times we don&#8217;t want that command print out messages, and we need to clean all out messages (error or standard out) that it generates. For to solve this, we are going to use the I/O facility provided by BASH.</p>
<p>BASH provide 3 file descriptors, and they are:<br />
<strong>0 &#8211; stdin</strong> &#8211; Used for get data.<br />
<strong>1 &#8211; stdout</strong> &#8211; Used for write standard data into screen.<br />
<strong>2 &#8211; stderr</strong> &#8211; Used for write error messages into screen.</p>
<p>So, using redirector (>) we can redirect(obviously) this data/messages wherever we want and also files.</p>
<p>Examples:<br />
¿How to redirect error messages(<strong>stderr</strong>) to standard out(<strong>stdout</strong>)?</p>
<p>ls this.file.doesnt.exist 2>&#038;1</p>
<p>¿How to redirect error messages(<strong>stderr</strong>) to limbo(/dev/null)?</p>
<p>ls this.file.doesnt.exist 2> /dev/null</p>
<p>¿How to redirect error(<strong>stderr</strong>) and standard out(<strong>stdout</strong>) messages to limbo?</p>
<p>ls this.file.doesnt.exist &#038;> /dev/null<br />
or<br />
ls this.file.doesnt.exist 2> /dev/null 1>&#038;2</p>
]]></content:encoded>
			<wfw:commentRss>http://lexo.lx-networks.net/2009/04/28/bash-io-stdout-stdin-and-stderr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
