<?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>tail -f /dev/null &#187; while</title>
	<atom:link href="http://tfdn.radiofreeomaha.net/tag/while/feed/" rel="self" type="application/rss+xml" />
	<link>http://tfdn.radiofreeomaha.net</link>
	<description>Tips, notes, HOWTOs</description>
	<lastBuildDate>Fri, 20 Aug 2010 04:13:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Process A File Line By Line In A Script</title>
		<link>http://tfdn.radiofreeomaha.net/2009/01/process-a-file-line-by-line-in-a-script/</link>
		<comments>http://tfdn.radiofreeomaha.net/2009/01/process-a-file-line-by-line-in-a-script/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 18:54:32 +0000</pubDate>
		<dc:creator>Uncle Jubba</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[do]]></category>
		<category><![CDATA[done]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://tfdn.radiofreeomaha.net/?p=59</guid>
		<description><![CDATA[There are multiple ways to skin this cat.  For now one of the simplest. #!/bin/sh while read LINE do ...DO SOME STUFF WITH THE ${LINE}... done &#60;somefile.txt Replace &#8220;somefile.txt&#8221; with the file you want to process. No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>There are multiple ways to skin this cat.  For now one of the simplest.</p>
<pre class="brush: bash">#!/bin/sh

while read LINE
do
...DO SOME STUFF WITH THE ${LINE}...
done &lt;somefile.txt</pre>
<p>Replace &#8220;somefile.txt&#8221; with the file you want to process.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://tfdn.radiofreeomaha.net/2009/01/process-a-file-line-by-line-in-a-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spawning Sub-Shells</title>
		<link>http://tfdn.radiofreeomaha.net/2008/12/spawning-sub-shells/</link>
		<comments>http://tfdn.radiofreeomaha.net/2008/12/spawning-sub-shells/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 21:59:56 +0000</pubDate>
		<dc:creator>Uncle Jubba</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[else]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[subshell]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://tfdn.radiofreeomaha.net/?p=48</guid>
		<description><![CDATA[Creating sub-shells in bash is simple: just put the commands to be run in the sub-shell inside parentheses. This causes bash to start the commands as a separate process. This group of commands essentially acts like a separate script file, their input/output can be collectively redirected and/or they can be executed in the background by [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<blockquote><p>Creating sub-shells in bash is simple: just put the commands to be run in the sub-shell inside parentheses. This causes bash to start the commands as a separate process. This group of commands essentially acts like a separate script file, their input/output can be collectively redirected and/or they can be executed in the background by following the closing parenthesis with an ampersand.</p></blockquote>
<pre>
<pre class="brush: bash">#!/bin/bash

server_cmd=server
pid_file=$(basename $server_cmd .sh).pid
log_file=$(basename $server_cmd .sh).log

(
    echo &quot;Starting server&quot;
    echo &quot;Doing some init work&quot;
    $server_cmd   # server becomes a daemon

    while true
    do
        if [[ -f $pid_file ]]; then
            sleep 15
        else
            break
        fi
    done
    mail -s &quot;Server exitted&quot; joe@example.com &lt;&lt;&lt;CRAP

) 2&gt;&amp;1 &gt;&gt; $log_file &amp;

echo &quot;Server started&quot;</pre>
<p>quote and example via <a href="http://www.linuxjournal.com/content/bash-sub-shells" target="_blank">LinuxJournal</a></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://tfdn.radiofreeomaha.net/2008/12/spawning-sub-shells/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increase Loadaverage</title>
		<link>http://tfdn.radiofreeomaha.net/2008/12/increase-loadaverage/</link>
		<comments>http://tfdn.radiofreeomaha.net/2008/12/increase-loadaverage/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 17:03:37 +0000</pubDate>
		<dc:creator>Uncle Jubba</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[loadavg]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://tfdn.radiofreeomaha.net/?p=17</guid>
		<description><![CDATA[Increase the load average on a machine for testing. while true; do w &#38; w &#38; w &#38; w; done No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Increase the load average on a machine for testing.</p>
<pre>
<pre class="brush: sh">while true; do w &amp; w &amp; w &amp; w; done</pre>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://tfdn.radiofreeomaha.net/2008/12/increase-loadaverage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

