<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Andrés J. Díaz</title>
	<atom:link href="http://ajdiaz.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://ajdiaz.wordpress.com</link>
	<description>Tips and tricks for system administration</description>
	<lastBuildDate>Wed, 19 Aug 2009 19:11:07 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on bash ini parser by ajdiaz</title>
		<link>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/#comment-346</link>
		<dc:creator>ajdiaz</dc:creator>
		<pubDate>Wed, 19 Aug 2009 19:11:07 +0000</pubDate>
		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=40#comment-346</guid>
		<description>Hi!

To put the ini contents in uppercase is easy, just change the line:
&lt;code&gt;IFS=$&#039;\n&#039; &amp;&amp; ini=( $(&lt;$1) )&lt;/code&gt;
by the line:
&lt;code&gt;IFS=$&#039;\n&#039; &amp;&amp; ini=( $(tr a-z A-Z &lt;$1) )&lt;/code&gt;

This will be work ok to you. About the spaces in sections, there are no a easy way to do this AFAIK.

I hope to help you a bit.

Regards,
  Andres</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>To put the ini contents in uppercase is easy, just change the line:<br />
<code>IFS=$'\n' &amp;&amp; ini=( $(&lt;$1) )</code><br />
by the line:<br />
<code>IFS=$'\n' &amp;&amp; ini=( $(tr a-z A-Z &lt;$1) )</code></p>
<p>This will be work ok to you. About the spaces in sections, there are no a easy way to do this AFAIK.</p>
<p>I hope to help you a bit.</p>
<p>Regards,<br />
  Andres</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on bash ini parser by nic</title>
		<link>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/#comment-345</link>
		<dc:creator>nic</dc:creator>
		<pubDate>Mon, 17 Aug 2009 22:04:12 +0000</pubDate>
		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=40#comment-345</guid>
		<description>Hello!

I tried the wonderful script and I&#039;m even starting to understand what it does.  I would like to modify the two areas where the text is converted to function and key names to do this: uppercase the names and in the case of the section name replace blank characters with underscore.  I don&#039;t know how to do this, especially since the script runs the regex for the whole file in one swing (IE not line by line).

Best regards</description>
		<content:encoded><![CDATA[<p>Hello!</p>
<p>I tried the wonderful script and I&#8217;m even starting to understand what it does.  I would like to modify the two areas where the text is converted to function and key names to do this: uppercase the names and in the case of the section name replace blank characters with underscore.  I don&#8217;t know how to do this, especially since the script runs the regex for the whole file in one swing (IE not line by line).</p>
<p>Best regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on bash ini parser by ajdiaz</title>
		<link>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/#comment-344</link>
		<dc:creator>ajdiaz</dc:creator>
		<pubDate>Thu, 21 May 2009 16:14:23 +0000</pubDate>
		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=40#comment-344</guid>
		<description>My original code, is also uploaded in pastebin: http://pastebin.com/f61ef4979

Feel free to add modifications :)</description>
		<content:encoded><![CDATA[<p>My original code, is also uploaded in pastebin: <a href="http://pastebin.com/f61ef4979" rel="nofollow">http://pastebin.com/f61ef4979</a></p>
<p>Feel free to add modifications <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on bash ini parser by bld</title>
		<link>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/#comment-343</link>
		<dc:creator>bld</dc:creator>
		<pubDate>Thu, 21 May 2009 13:56:45 +0000</pubDate>
		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=40#comment-343</guid>
		<description>This Bash ini parser may be easier to cut &amp; paste:

http://codesnippets.joyent.com/posts/show/2060

cheers,

bld</description>
		<content:encoded><![CDATA[<p>This Bash ini parser may be easier to cut &amp; paste:</p>
<p><a href="http://codesnippets.joyent.com/posts/show/2060" rel="nofollow">http://codesnippets.joyent.com/posts/show/2060</a></p>
<p>cheers,</p>
<p>bld</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on bash ini parser by neofutur</title>
		<link>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/#comment-342</link>
		<dc:creator>neofutur</dc:creator>
		<pubDate>Wed, 20 May 2009 04:17:11 +0000</pubDate>
		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=40#comment-342</guid>
		<description>useful post, but the wordpress format makes it a hell to use it.

what about packaging this in a .tar.gz and give the download link ?</description>
		<content:encoded><![CDATA[<p>useful post, but the wordpress format makes it a hell to use it.</p>
<p>what about packaging this in a .tar.gz and give the download link ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on bash ini parser by Markus E.</title>
		<link>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/#comment-339</link>
		<dc:creator>Markus E.</dc:creator>
		<pubDate>Thu, 07 May 2009 12:34:07 +0000</pubDate>
		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=40#comment-339</guid>
		<description>nice work!

the error described in first post occurs if a section does not contain values. 
this can be solved by adding any command between the brackets which are evaluated by eval(). 

i think, there could be a better solution, but following works;
replace: 
ni[${#ini[*]} + 1]=’}’ # add the last brace

with something like: 
ini[${#ini[*]} + 1]=&#039;echo -n; }&#039;</description>
		<content:encoded><![CDATA[<p>nice work!</p>
<p>the error described in first post occurs if a section does not contain values.<br />
this can be solved by adding any command between the brackets which are evaluated by eval(). </p>
<p>i think, there could be a better solution, but following works;<br />
replace:<br />
ni[${#ini[*]} + 1]=’}’ # add the last brace</p>
<p>with something like:<br />
ini[${#ini[*]} + 1]=&#8217;echo -n; }&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on bash ini parser by Piotr Gabryjeluk</title>
		<link>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/#comment-333</link>
		<dc:creator>Piotr Gabryjeluk</dc:creator>
		<pubDate>Mon, 23 Feb 2009 11:57:05 +0000</pubDate>
		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=40#comment-333</guid>
		<description>Yeah, should be

local IFS instead of just IFS

the rest of the script seemed a bit magic to me at first, but anyway nice peace of work. (I would suggest not using a dot in name of function).</description>
		<content:encoded><![CDATA[<p>Yeah, should be</p>
<p>local IFS instead of just IFS</p>
<p>the rest of the script seemed a bit magic to me at first, but anyway nice peace of work. (I would suggest not using a dot in name of function).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on bash ini parser by Brooks Moses</title>
		<link>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/#comment-332</link>
		<dc:creator>Brooks Moses</dc:creator>
		<pubDate>Thu, 15 Jan 2009 23:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=40#comment-332</guid>
		<description>Maceij: Why not just use &quot;local IFS&quot; at the top of the function?</description>
		<content:encoded><![CDATA[<p>Maceij: Why not just use &#8220;local IFS&#8221; at the top of the function?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on pkgcore experience by Brian Harring</title>
		<link>http://ajdiaz.wordpress.com/2008/05/10/pkgcore-experience/#comment-331</link>
		<dc:creator>Brian Harring</dc:creator>
		<pubDate>Sat, 06 Dec 2008 03:34:02 +0000</pubDate>
		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=46#comment-331</guid>
		<description>The ini format you used is pretty damn low level- frankly there isn&#039;t any reason to drop down to that level unless you actually need to do something fairly crazy.

Even then, you can intermix formats easily enough- in other words you could do an ini override of make.conf for example.

Either way, ini is not the intended format for majority of users- it&#039;s pretty much the intended format for if you need to do something fairly hanky (remote configuration, complex cache setups, etc).</description>
		<content:encoded><![CDATA[<p>The ini format you used is pretty damn low level- frankly there isn&#8217;t any reason to drop down to that level unless you actually need to do something fairly crazy.</p>
<p>Even then, you can intermix formats easily enough- in other words you could do an ini override of make.conf for example.</p>
<p>Either way, ini is not the intended format for majority of users- it&#8217;s pretty much the intended format for if you need to do something fairly hanky (remote configuration, complex cache setups, etc).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on bash ini parser by Maciej Pasternacki</title>
		<link>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/#comment-330</link>
		<dc:creator>Maciej Pasternacki</dc:creator>
		<pubDate>Wed, 19 Nov 2008 22:02:35 +0000</pubDate>
		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=40#comment-330</guid>
		<description>One more fix: script changes $IFS and doesn&#039;t restore previous value.  Took me quote a moment of debugging, why the hell after reading config word splitting doesn&#039;t work as they used to (e.g. LS=&quot;ls -a&quot;;$LS doesn&#039;t work, because bash tries to find and execute &quot;ls -a&quot; command, including space and parameter).  Fixed version:

function cfg.parser ()
{
    _old_IFS=&quot;$IFS&quot;               # save $IFS
    IFS=$&#039;\n&#039; &amp;&amp; ini=( $(&lt;$1) ) # convert to line-array
    ini=( ${ini[*]//;*/} ) # remove comments `;&#039;
    ini=( ${ini[*]//\#*/} ) # remove comments `#&#039;
    ini=( ${ini[*]/\ =\ /=} ) # remove anything with a space around `=`
    ini=( ${ini[*]/#[/\}$&#039;\n&#039;cfg.section.} ) # set section prefix
        ini=( ${ini[*]/%]/ \(} ) # convert text2function (1)
    ini=( ${ini[*]/=/=\( } ) # convert item to array
    ini=( ${ini[*]/%/ \)} ) # close array parenthesis
    ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2)
    ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis
    ini=( ${ini[*]/#\ */} ) # remove blank lines
    ini=( ${ini[*]/#\ */} ) # remove blank lines with tabs
    ini[0]=&#039;&#039; # remove first element
    ini[${#ini[*]} + 1]=&#039;}&#039; # add the last brace
    # printf &quot;%s\n&quot; ${ini[*]}
    eval &quot;$(echo &quot;${ini[*]}&quot;)&quot; # eval the result
    if [ -z &quot;$_old_IFS&quot; ]       # restore old $IFS
        then unset IFS
        else IFS=&quot;$_old_IFS&quot;
    fi
}</description>
		<content:encoded><![CDATA[<p>One more fix: script changes $IFS and doesn&#8217;t restore previous value.  Took me quote a moment of debugging, why the hell after reading config word splitting doesn&#8217;t work as they used to (e.g. LS=&#8221;ls -a&#8221;;$LS doesn&#8217;t work, because bash tries to find and execute &#8220;ls -a&#8221; command, including space and parameter).  Fixed version:</p>
<p>function cfg.parser ()<br />
{<br />
    _old_IFS=&#8221;$IFS&#8221;               # save $IFS<br />
    IFS=$&#8217;\n&#8217; &amp;&amp; ini=( $(&lt;$1) ) # convert to line-array<br />
    ini=( ${ini[*]//;*/} ) # remove comments `;&#8217;<br />
    ini=( ${ini[*]//\#*/} ) # remove comments `#&#8217;<br />
    ini=( ${ini[*]/\ =\ /=} ) # remove anything with a space around `=`<br />
    ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix<br />
        ini=( ${ini[*]/%]/ \(} ) # convert text2function (1)<br />
    ini=( ${ini[*]/=/=\( } ) # convert item to array<br />
    ini=( ${ini[*]/%/ \)} ) # close array parenthesis<br />
    ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2)<br />
    ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis<br />
    ini=( ${ini[*]/#\ */} ) # remove blank lines<br />
    ini=( ${ini[*]/#\ */} ) # remove blank lines with tabs<br />
    ini[0]=&#8221; # remove first element<br />
    ini[${#ini[*]} + 1]=&#8217;}&#8217; # add the last brace<br />
    # printf &#8220;%s\n&#8221; ${ini[*]}<br />
    eval &#8220;$(echo &#8220;${ini[*]}&#8221;)&#8221; # eval the result<br />
    if [ -z "$_old_IFS" ]       # restore old $IFS<br />
        then unset IFS<br />
        else IFS=&#8221;$_old_IFS&#8221;<br />
    fi<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
