<?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>kb.hurricane-ridge.com &#187; Bash</title>
	<atom:link href="http://kb.hurricane-ridge.com/category/scripting/bash/feed" rel="self" type="application/rss+xml" />
	<link>http://kb.hurricane-ridge.com</link>
	<description>My personal - but public - knowledge base</description>
	<lastBuildDate>Mon, 09 Jan 2012 14:49:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Bash Programming Cheat Sheet</title>
		<link>http://kb.hurricane-ridge.com/scripting/bash/bash-programming-cheat-sheet</link>
		<comments>http://kb.hurricane-ridge.com/scripting/bash/bash-programming-cheat-sheet#comments</comments>
		<pubDate>Tue, 30 Dec 2008 20:28:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=54</guid>
		<description><![CDATA[A quick overview of Bash shell syntax: JustLinux&#8217;s Bash Programming Cheat Sheet.]]></description>
			<content:encoded><![CDATA[<p>A quick overview of Bash shell syntax: <a href="http://www.justlinux.com/nhf/Programming/Bash_Programming_Cheat_Sheet.html">JustLinux&#8217;s Bash Programming Cheat Sheet</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/scripting/bash/bash-programming-cheat-sheet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loop Over Each Line in a File using Bash</title>
		<link>http://kb.hurricane-ridge.com/scripting/bash/loop-over-each-line-in-a-file-using-bash</link>
		<comments>http://kb.hurricane-ridge.com/scripting/bash/loop-over-each-line-in-a-file-using-bash#comments</comments>
		<pubDate>Sun, 28 Dec 2008 23:40:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=8</guid>
		<description><![CDATA[Use exec as below, for example: exec &#60; $PASSWORD_FILE while read LINE; do user=`echo $LINE &#124; cut -d: -f1` uid=`echo $LINE &#124; cut -d: -f3` pgroup=`echo $LINE &#124; cut -d: -f4` homedir=`echo $LINE &#124; cut -d: -f6` shell=`echo $LINE &#124; cut -d: -f7` gecos=`echo $LINE &#124; cut -d: -f5` cmd="/usr/sbin/useradd -u $uid -g $pgroup -d [...]]]></description>
			<content:encoded><![CDATA[<p>Use exec as below, for example:</p>
<pre><code>exec &lt; $PASSWORD_FILE
while read LINE; do
  user=`echo $LINE | cut -d: -f1`
  uid=`echo $LINE | cut -d: -f3`
  pgroup=`echo $LINE | cut -d: -f4`
  homedir=`echo $LINE | cut -d: -f6`
  shell=`echo $LINE | cut -d: -f7`
  gecos=`echo $LINE | cut -d: -f5`
  cmd="/usr/sbin/useradd -u $uid -g $pgroup -d $homedir -s $shell -c $gecos $user"
done</code></pre>
<p>You may need to store stdin within another file descriptor if you need your script to receive input from stdin after the loop runs.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/scripting/bash/loop-over-each-line-in-a-file-using-bash/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

