<?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>BASH Cures Cancer &#187; Links</title>
	<atom:link href="http://bashcurescancer.com/category/links/feed" rel="self" type="application/rss+xml" />
	<link>http://bashcurescancer.com</link>
	<description>Learn the UNIX/Linux command line</description>
	<lastBuildDate>Tue, 25 Oct 2011 18:09:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>The best in command line xml: XMLStarlet</title>
		<link>http://bashcurescancer.com/the-best-in-command-line-xml-xmlstarlet.html</link>
		<comments>http://bashcurescancer.com/the-best-in-command-line-xml-xmlstarlet.html#comments</comments>
		<pubDate>Tue, 24 Jun 2008 04:32:48 +0000</pubDate>
		<dc:creator>Brock Noland</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://bashcurescancer.com/?p=151</guid>
		<description><![CDATA[Quite some time ago I wrote about using xsltproc to process xml on the command line. Thank fully someone pointed out XMLStarlet.  I now use XMLStarlet almost every day.  I work with a variety of REST based API&#8217;s gather information. XMLStartlet along with a simple for loop or xargs gives you an exceedingly powerful set [...]]]></description>
			<content:encoded><![CDATA[<p>Quite some time ago I wrote about using xsltproc to process xml on the command line. Thank fully someone pointed out <a href="http://xmlstar.sourceforge.net/">XMLStarlet</a>.  I now use XMLStarlet almost every day.  I work with a variety of REST based API&#8217;s gather information. XMLStartlet along with a simple for loop or xargs gives you an exceedingly powerful set of tools.</p>
<p>Here is a quick introduction into the power of XMLStarlet. This is just a teaser as I cannot share the data I work with. However, you should be able to see the power of this tool.</p>
<p>All the links from my RSS feed:</p>
<pre>$ curl -s 'http://bashcurescancer.com/rss/' | xml sel -t -m '//link' -v '.' -n

http://bashcurescancer.com</pre>
<pre>http://bashcurescancer.com/processing-xml-on-the-command-line.html

http://bashcurescancer.com/do-not-close-stderr.html</pre>
<pre>http://bashcurescancer.com/prepend-to-a-file-with-sponge-from-moreutils.html</pre>
<pre>http://bashcurescancer.com/bug-in-curl-is-fixed.html</pre>
<pre>http://bashcurescancer.com/using-kill-to-see-if-a-process-is-alive.html</pre>
<pre>http://bashcurescancer.com/performance-testing-with-curl.html</pre>
<pre>http://bashcurescancer.com/new-command-prepend.html</pre>
<pre>http://bashcurescancer.com/shell-function-which-webserver-does-that-site-run.html</pre>
<pre>http://bashcurescancer.com/exposing-command-line-programs-as-web-services.html

http://bashcurescancer.com/wrapping-dynamic-languages-in-shell-without-an-extra-script.html</pre>
<p>Or how about &#8220;Title: link&#8221;</p>
<pre>$ curl -s 'http://bashcurescancer.com/rss/' | xml sel -t -m '//item' -v 'title' -o ': ' -v 'link' -n</pre>
<pre>Processing XML on the Command Line: http://bashcurescancer.com/processing-xml-on-the-command-line.html</pre>
<pre>Do not close stderr: http://bashcurescancer.com/do-not-close-stderr.html</pre>
<pre>prepend to a file with sponge from moreutils: http://bashcurescancer.com/prepend-to-a-file-with-sponge-from-moreutils.html</pre>
<pre>Bug in Curl is fixed: http://bashcurescancer.com/bug-in-curl-is-fixed.html</pre>
<pre>using kill to see if a process is alive: http://bashcurescancer.com/using-kill-to-see-if-a-process-is-alive.html</pre>
<pre>Performance testing - with curl: http://bashcurescancer.com/performance-testing-with-curl.html</pre>
<pre>New command: prepend: http://bashcurescancer.com/new-command-prepend.html</pre>
<pre>Shell Function - Which Webserver Does That Site Run?: http://bashcurescancer.com/shell-function-which-webserver-does-that-site-run.html</pre>
<pre>Exposing command line programs as web services: http://bashcurescancer.com/exposing-command-line-programs-as-web-services.html</pre>
<pre>Wrapping dynamic languages in shell without an extra script: http://bashcurescancer.com/wrapping-dynamic-languages-in-shell-without-an-extra-script.html</pre>
<p>You may need to do some reading on xpaths and xsl stylesheets to use the full power of the tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://bashcurescancer.com/the-best-in-command-line-xml-xmlstarlet.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>using kill to see if a process is alive</title>
		<link>http://bashcurescancer.com/using-kill-to-see-if-a-process-is-alive.html</link>
		<comments>http://bashcurescancer.com/using-kill-to-see-if-a-process-is-alive.html#comments</comments>
		<pubDate>Thu, 10 Apr 2008 04:43:55 +0000</pubDate>
		<dc:creator>Brock Noland</dc:creator>
				<category><![CDATA[Brock's Tools]]></category>
		<category><![CDATA[Good Practice]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[ps]]></category>
		<category><![CDATA[ps -ef]]></category>
		<category><![CDATA[ps faux]]></category>
		<category><![CDATA[ps grep]]></category>

		<guid isPermaLink="false">http://bashcurescancer.com/?p=141</guid>
		<description><![CDATA[I am making some changes to the moreutils sponge command. Sponge provides a method of prepending which is less specialized than my prepend util. However, it has trouble with large amounts of input. Regardless, while testing my changes, I want to watch it operate. Normally, you would just do so from a second terminal. That [...]]]></description>
			<content:encoded><![CDATA[<p>I am making some changes to the <a href="http://kitenet.net/~joey/code/moreutils/">moreutils</a> sponge command.  Sponge provides a method of prepending which is less specialized than my <a href="http://bashcurescancer.com/new-command-prepend.html">prepend</a> util. However, it has trouble with large amounts of input.</p>
<p>Regardless, while testing my changes, I want to watch it operate. Normally, you would just do so from a second terminal. That is a pain. kill -0 can be very useful for this. After backgrounding the command, I assign the pid (via the variable $!) to $pid using eval. eval is needed to stop BASH from expanding $! until after the background operation.</p>
<p>After that, I enter a while loop on kill -0 $pid, which will not kill $pid, but will return successfully until $pid has died:</p>
<pre># cat large-file-GB | ./sponge large-file-GB-copy &amp; eval 'pid=$!'; while kill -0 $pid; do sleep 10; ls -lh large-file* /tmp/sponge.*; echo;done
[1] 7937
-rw-r--r-- 1 root root 977M 2008-04-09 16:18 large-file-GB
-rw------- 1 root root 128M 2008-04-09 17:23 /tmp/sponge.JMsBWG

-rw-r--r-- 1 root root 977M 2008-04-09 16:18 large-file-GB
-rw------- 1 root root 384M 2008-04-09 17:23 /tmp/sponge.JMsBWG

-rw-r--r-- 1 root root 977M 2008-04-09 16:18 large-file-GB
-rw------- 1 root root 877M 2008-04-09 17:24 /tmp/sponge.JMsBWG

-rw-r--r-- 1 root root 977M 2008-04-09 16:18 large-file-GB
-rw-r--r-- 1 root root  20M 2008-04-09 17:24 large-file-GB-copy
-rw------- 1 root root 896M 2008-04-09 17:24 /tmp/sponge.JMsBWG

-rw-r--r-- 1 root root 977M 2008-04-09 16:18 large-file-GB
-rw-r--r-- 1 root root 413M 2008-04-09 17:25 large-file-GB-copy
-rw------- 1 root root 896M 2008-04-09 17:24 /tmp/sponge.JMsBWG

-rw-r--r-- 1 root root 977M 2008-04-09 16:18 large-file-GB
-rw-r--r-- 1 root root 836M 2008-04-09 17:25 large-file-GB-copy
-rw------- 1 root root 896M 2008-04-09 17:24 /tmp/sponge.JMsBWG

-rw-r--r-- 1 root root 977M 2008-04-09 16:18 large-file-GB
-rw-r--r-- 1 root root 920M 2008-04-09 17:25 large-file-GB-copy
[1]+  Done                    cat large-file-GB | ./sponge large-file-GB-copy
ls: cannot access /tmp/sponge.*: No such file or directory

-rw-r--r-- 1 root root 977M 2008-04-09 16:18 large-file-GB
-rw-r--r-- 1 root root 977M 2008-04-09 17:25 large-file-GB-copy
-bash: kill: (7937) - No such process
# md5sum large-file-GB*
b5c667a723a10a3485a33263c4c2b978  large-file-GB
b5c667a723a10a3485a33263c4c2b978  large-file-GB-copy</pre>
]]></content:encoded>
			<wfw:commentRss>http://bashcurescancer.com/using-kill-to-see-if-a-process-is-alive.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Linux Command Line Tips &amp; Reference Sheet</title>
		<link>http://bashcurescancer.com/linux-command-line-tips-reference-sheet.html</link>
		<comments>http://bashcurescancer.com/linux-command-line-tips-reference-sheet.html#comments</comments>
		<pubDate>Mon, 22 Oct 2007 05:41:59 +0000</pubDate>
		<dc:creator>Brock Noland</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://bashcurescancer.com/linux-command-line-tips-reference-sheet.html</guid>
		<description><![CDATA[This &#8220;Linux Command Line Tips&#8221; is a supberb listing of options, commands, and pipe lines. I&#8217;d suggest bookmarking. Note: I want BASH Cures Cancer to be original content. However, this list was too good, so I had to share.]]></description>
			<content:encoded><![CDATA[<p>This &#8220;<a href="http://www.pixelbeat.org/cmdline.html">Linux Command Line Tips</a>&#8221; is a supberb listing of options, commands, and pipe lines. I&#8217;d suggest bookmarking.</p>
<p><em>Note:  I want BASH Cures Cancer to be original content.  However, this list was too good, so I had to share.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://bashcurescancer.com/linux-command-line-tips-reference-sheet.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

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

