<?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"
	>
<channel>
	<title>Comments on: Bash User Input Validation</title>
	<atom:link href="http://www.savvyadmin.com/bash-user-input-validation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.savvyadmin.com/bash-user-input-validation/</link>
	<description>For savvy admins everywhere...</description>
	<pubDate>Wed, 07 Jan 2009 03:05:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: buddyh</title>
		<link>http://www.savvyadmin.com/bash-user-input-validation/#comment-249</link>
		<dc:creator>buddyh</dc:creator>
		<pubDate>Tue, 21 Oct 2008 11:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=62#comment-249</guid>
		<description>As a learning admin this is great info.  I thought there was a way to limit the input to a specific set of characters.  I just need to have the user input a Y or N in either upper or lower case and reject any other entry.  Thinking of using a while loop till a correct char is entered as an alternative.  
Tx in advance</description>
		<content:encoded><![CDATA[<p>As a learning admin this is great info.  I thought there was a way to limit the input to a specific set of characters.  I just need to have the user input a Y or N in either upper or lower case and reject any other entry.  Thinking of using a while loop till a correct char is entered as an alternative.<br />
Tx in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: al</title>
		<link>http://www.savvyadmin.com/bash-user-input-validation/#comment-246</link>
		<dc:creator>al</dc:creator>
		<pubDate>Thu, 16 Oct 2008 22:08:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=62#comment-246</guid>
		<description>Thanks a bunch - I'll remember this one.</description>
		<content:encoded><![CDATA[<p>Thanks a bunch - I&#8217;ll remember this one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gmendoza</title>
		<link>http://www.savvyadmin.com/bash-user-input-validation/#comment-245</link>
		<dc:creator>gmendoza</dc:creator>
		<pubDate>Thu, 16 Oct 2008 18:17:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=62#comment-245</guid>
		<description>Easy... use sed to strip beginning and trailing spaces:

tr -cd '[:alnum:] [:space:]' &#124; sed -e 's/^[ ]*//' -e 's/[ ]*$//'</description>
		<content:encoded><![CDATA[<p>Easy&#8230; use sed to strip beginning and trailing spaces:</p>
<p>tr -cd &#8216;[:alnum:] [:space:]&#8216; | sed -e &#8217;s/^[ ]*//&#8217; -e &#8217;s/[ ]*$//&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: al</title>
		<link>http://www.savvyadmin.com/bash-user-input-validation/#comment-244</link>
		<dc:creator>al</dc:creator>
		<pubDate>Thu, 16 Oct 2008 14:18:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=62#comment-244</guid>
		<description>I actually did that. But please consider following - someone puts in the username "al_the_on___the_sea". I wouldn't want to shrink it to "altheon" after cutting 10 spaces, but would rather have "al_the_on" . This would make it 9 char, but if the last space was left "al_the_on_" it would be user difficult to use such a name. I tried different ways, but nothing easy came about. If you have some sort of solution, I would be all ears. Also from programming perspective, one would have to check from the back of the string moving forward until first alphanumeric character was found.</description>
		<content:encoded><![CDATA[<p>I actually did that. But please consider following - someone puts in the username &#8220;al_the_on___the_sea&#8221;. I wouldn&#8217;t want to shrink it to &#8220;altheon&#8221; after cutting 10 spaces, but would rather have &#8220;al_the_on&#8221; . This would make it 9 char, but if the last space was left &#8220;al_the_on_&#8221; it would be user difficult to use such a name. I tried different ways, but nothing easy came about. If you have some sort of solution, I would be all ears. Also from programming perspective, one would have to check from the back of the string moving forward until first alphanumeric character was found.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gmendoza</title>
		<link>http://www.savvyadmin.com/bash-user-input-validation/#comment-243</link>
		<dc:creator>gmendoza</dc:creator>
		<pubDate>Wed, 15 Oct 2008 19:55:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=62#comment-243</guid>
		<description>Hi there.  The example in the post explains that alphanumeric and spaces are allowed.  Simply omit the [space] value, and you'll be left strictly with alphanumeric.  For example:

tr -cd '[:alnum:]'
</description>
		<content:encoded><![CDATA[<p>Hi there.  The example in the post explains that alphanumeric and spaces are allowed.  Simply omit the [space] value, and you&#8217;ll be left strictly with alphanumeric.  For example:</p>
<p>tr -cd &#8216;[:alnum:]&#8216;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: al</title>
		<link>http://www.savvyadmin.com/bash-user-input-validation/#comment-242</link>
		<dc:creator>al</dc:creator>
		<pubDate>Wed, 15 Oct 2008 19:49:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=62#comment-242</guid>
		<description>I had something similar to complete not too long ago. I found it very hard to manipulate last characters going backwards in order to edit spaces. Example 10 character password al--------, where "-" is equal to space. In order to check for that and concatenate to just "al" instead of "al          " - what approach would you use?</description>
		<content:encoded><![CDATA[<p>I had something similar to complete not too long ago. I found it very hard to manipulate last characters going backwards in order to edit spaces. Example 10 character password al&#8212;&#8212;&#8211;, where &#8220;-&#8221; is equal to space. In order to check for that and concatenate to just &#8220;al&#8221; instead of &#8220;al          &#8221; - what approach would you use?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amarendra</title>
		<link>http://www.savvyadmin.com/bash-user-input-validation/#comment-219</link>
		<dc:creator>Amarendra</dc:creator>
		<pubDate>Fri, 05 Sep 2008 10:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=62#comment-219</guid>
		<description>Interesting, and neat, especially the white-listing part.</description>
		<content:encoded><![CDATA[<p>Interesting, and neat, especially the white-listing part.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
