<?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: Splitting Strings Natively with the Shell: Why</title>
	<atom:link href="http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html/feed" rel="self" type="application/rss+xml" />
	<link>http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html</link>
	<description>Learn the UNIX/Linux command line</description>
	<lastBuildDate>Mon, 06 Jun 2011 01:35:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Luke Shumaker</title>
		<link>http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html/comment-page-1#comment-40838</link>
		<dc:creator>Luke Shumaker</dc:creator>
		<pubDate>Wed, 02 Jun 2010 17:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/?p=167#comment-40838</guid>
		<description>Sorry to burst your bubble, but:

sed -n &#039;s@^\(.*\):\(.*\):\(...*\):\(.*\):\(.*\):\(.*\):/bin/nologin$@\1@p&#039; /etc/passwd

---Sed---

real	0m0.015s
user	0m0.000s
sys	0m0.004s

---Cut---

real	0m4.066s
user	0m1.336s
sys	0m2.004s

---Awk---

real	0m2.523s
user	0m0.576s
sys	0m1.716s

---Native---

real	0m0.066s
user	0m0.060s
sys	0m0.000s


Although, it wouldn&#039;t have been possible if you&#039;d specified a uid of, say, 15. I was able to rely on the fact that &gt;10 = at least 2 digits for mine.</description>
		<content:encoded><![CDATA[<p>Sorry to burst your bubble, but:</p>
<p>sed -n &#8216;s@^\(.*\):\(.*\):\(&#8230;*\):\(.*\):\(.*\):\(.*\):/bin/nologin$@\1@p&#8217; /etc/passwd</p>
<p>&#8212;Sed&#8212;</p>
<p>real	0m0.015s<br />
user	0m0.000s<br />
sys	0m0.004s</p>
<p>&#8212;Cut&#8212;</p>
<p>real	0m4.066s<br />
user	0m1.336s<br />
sys	0m2.004s</p>
<p>&#8212;Awk&#8212;</p>
<p>real	0m2.523s<br />
user	0m0.576s<br />
sys	0m1.716s</p>
<p>&#8212;Native&#8212;</p>
<p>real	0m0.066s<br />
user	0m0.060s<br />
sys	0m0.000s</p>
<p>Although, it wouldn&#8217;t have been possible if you&#8217;d specified a uid of, say, 15. I was able to rely on the fact that &gt;10 = at least 2 digits for mine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Катя</title>
		<link>http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html/comment-page-1#comment-36430</link>
		<dc:creator>Катя</dc:creator>
		<pubDate>Wed, 27 Jan 2010 19:39:52 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/?p=167#comment-36430</guid>
		<description>&lt;strong&gt;&lt;a href=&quot;http://nzk.mp3fs.ru&quot; rel=&quot;nofollow&quot;&gt; &lt;/a&gt;&lt;a href=&quot;http://nzn.mp3fs.ru&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://nzd.mp3fs.ru&quot; rel=&quot;nofollow&quot;&gt; &lt;/a&gt;&lt;a href=&quot;http://nzh.mp3fs.ru&quot; rel=&quot;nofollow&quot;&gt; &lt;/a&gt;...&lt;/strong&gt;

Хм&lt;b&gt;&lt;a href=&quot;http://nz2.mp3fs.ru&quot; rel=&quot;nofollow&quot;&gt; &lt;/a&gt;&lt;a href=&quot;http://nz3.mp3fs.ru&quot; rel=&quot;nofollow&quot;&gt; &lt;/a&gt;&lt;a href=&quot;http://nz4.mp3fs.ru&quot; rel=&quot;nofollow&quot;&gt; &lt;/a&gt;&lt;a href=&quot;http://nz5.mp3fs.ru&quot; rel=&quot;nofollow&quot;&gt; &lt;/a&gt;...</description>
		<content:encoded><![CDATA[<p><strong><a href="http://nzk.mp3fs.ru" rel="nofollow"> </a><a href="http://nzn.mp3fs.ru" rel="nofollow"></a><a href="http://nzd.mp3fs.ru" rel="nofollow"> </a><a href="http://nzh.mp3fs.ru" rel="nofollow"> </a>&#8230;</strong></p>
<p>Хм<b><a href="http://nz2.mp3fs.ru" rel="nofollow"> </a><a href="http://nz3.mp3fs.ru" rel="nofollow"> </a><a href="http://nz4.mp3fs.ru" rel="nofollow"> </a><a href="http://nz5.mp3fs.ru" rel="nofollow"> </a>&#8230;</b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris F.A. Johnson</title>
		<link>http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html/comment-page-1#comment-34854</link>
		<dc:creator>Chris F.A. Johnson</dc:creator>
		<pubDate>Sun, 20 Dec 2009 05:25:29 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/?p=167#comment-34854</guid>
		<description>That should be:

&lt;pre&gt;tr -d &#039;\04&#039;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>That should be:</p>
<pre>tr -d '\04'</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris F.A. Johnson</title>
		<link>http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html/comment-page-1#comment-34853</link>
		<dc:creator>Chris F.A. Johnson</dc:creator>
		<pubDate>Sun, 20 Dec 2009 05:24:18 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/?p=167#comment-34853</guid>
		<description>tr -d &#039;4&#039;</description>
		<content:encoded><![CDATA[<p>tr -d &#8217;4&#8242;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brock Noland</title>
		<link>http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html/comment-page-1#comment-34372</link>
		<dc:creator>Brock Noland</dc:creator>
		<pubDate>Thu, 10 Dec 2009 06:43:49 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/?p=167#comment-34372</guid>
		<description>I do not believe there is a way to &quot;filter&quot; out the EOF.</description>
		<content:encoded><![CDATA[<p>I do not believe there is a way to &#8220;filter&#8221; out the EOF.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html/comment-page-1#comment-34371</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 10 Dec 2009 06:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/?p=167#comment-34371</guid>
		<description>Doh. I should have thought of using fifos...

Dumb suggestion: if you were totally desperate to use cut or awk in this way, could you convince tr to filter out EOF (that is, ^D = 0x04) to something less destructive? I wonder if tr is coded to allow this behavior. Just send a signal later to cut to get it to die.</description>
		<content:encoded><![CDATA[<p>Doh. I should have thought of using fifos&#8230;</p>
<p>Dumb suggestion: if you were totally desperate to use cut or awk in this way, could you convince tr to filter out EOF (that is, ^D = 0&#215;04) to something less destructive? I wonder if tr is coded to allow this behavior. Just send a signal later to cut to get it to die.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Splitting Strings Natively with the Shell: Native vs Native</title>
		<link>http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html/comment-page-1#comment-34365</link>
		<dc:creator>Splitting Strings Natively with the Shell: Native vs Native</dc:creator>
		<pubDate>Thu, 10 Dec 2009 04:57:42 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/?p=167#comment-34365</guid>
		<description>[...] my previous post on why to split strings with bash itself, I used set to split the [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on why to split strings with bash itself, I used set to split the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brock Noland</title>
		<link>http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html/comment-page-1#comment-34364</link>
		<dc:creator>Brock Noland</dc:creator>
		<pubDate>Thu, 10 Dec 2009 04:36:57 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/?p=167#comment-34364</guid>
		<description>Yes, you are correct!

However I do not see how that would work.  One thought would be to set them up to listen to a fifo, ensure they are &lt;a href=&quot;http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00164.html&quot; rel=&quot;nofollow&quot;&gt;line buffered&lt;/a&gt;, and have them ignore EOF, you could send them a single line and get a single response.

Like this:

# make fifo
mkfifo awk-input-username
mkfifo awk-output-username
awk -F: &#039;{print $1} &lt; awk-input-username &gt; awk-output-username
....
# get username
echo $line &gt; awk-input-username &amp;
read username &lt; awk-output-username

Of course they do NOT ignore EOF so the awk process will exit after reading a single line.</description>
		<content:encoded><![CDATA[<p>Yes, you are correct!</p>
<p>However I do not see how that would work.  One thought would be to set them up to listen to a fifo, ensure they are <a href="http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00164.html" rel="nofollow">line buffered</a>, and have them ignore EOF, you could send them a single line and get a single response.</p>
<p>Like this:</p>
<p># make fifo<br />
mkfifo awk-input-username<br />
mkfifo awk-output-username<br />
awk -F: &#8216;{print $1} < awk-input-username > awk-output-username<br />
&#8230;.<br />
# get username<br />
echo $line > awk-input-username &#038;<br />
read username < awk-output-username</p>
<p>Of course they do NOT ignore EOF so the awk process will exit after reading a single line.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://bashcurescancer.com/splitting-strings-natively-with-the-shell-why.html/comment-page-1#comment-34362</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 10 Dec 2009 04:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/?p=167#comment-34362</guid>
		<description>The overhead is most likely due to the system call overhead of spawning and starting (fork()ing and exec()ing) the awk and cut processes. It would be interesting to see how &quot;already started&quot; cut and awk compare with bash/IFS speedwise.</description>
		<content:encoded><![CDATA[<p>The overhead is most likely due to the system call overhead of spawning and starting (fork()ing and exec()ing) the awk and cut processes. It would be interesting to see how &#8220;already started&#8221; cut and awk compare with bash/IFS speedwise.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.214 seconds -->

