<?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/"
		>
<channel>
	<title>Comments on: bash shell script declaring/creating arrays</title>
	<atom:link href="http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/</link>
	<description>Computer and technology tutorials and guides</description>
	<lastBuildDate>Sat, 21 Nov 2009 22:16:28 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: asd</title>
		<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/comment-page-1/#comment-16257</link>
		<dc:creator>asd</dc:creator>
		<pubDate>Wed, 11 Nov 2009 20:21:22 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-16257</guid>
		<description>asdasdasd</description>
		<content:encoded><![CDATA[<p>asdasdasd</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: af</title>
		<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/comment-page-1/#comment-16256</link>
		<dc:creator>af</dc:creator>
		<pubDate>Wed, 11 Nov 2009 20:20:36 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-16256</guid>
		<description>asd</description>
		<content:encoded><![CDATA[<p>asd</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob.experience</title>
		<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/comment-page-1/#comment-10867</link>
		<dc:creator>bob.experience</dc:creator>
		<pubDate>Tue, 28 Apr 2009 09:35:28 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-10867</guid>
		<description>Well done man! Thanks for the tip!</description>
		<content:encoded><![CDATA[<p>Well done man! Thanks for the tip!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manav</title>
		<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/comment-page-1/#comment-10298</link>
		<dc:creator>Manav</dc:creator>
		<pubDate>Mon, 13 Apr 2009 07:49:19 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-10298</guid>
		<description>Good one</description>
		<content:encoded><![CDATA[<p>Good one</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik J</title>
		<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/comment-page-1/#comment-7937</link>
		<dc:creator>Erik J</dc:creator>
		<pubDate>Thu, 29 Jan 2009 11:00:11 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-7937</guid>
		<description>Reading a line, while preseriving whitespaces seems har dto do from a  file&lt;br&gt;&lt;br&gt;You can do it this way:&lt;br&gt;&lt;pre&gt;&lt;br&gt;cat $file &#124; while read line; do&lt;br&gt;		echo &quot;$line&quot;;&lt;br&gt;done&lt;br&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Reading a line, while preseriving whitespaces seems har dto do from a  file</p>
<p>You can do it this way:<br />&lt;pre&gt;<br />cat $file | while read line; do<br />		echo &#8220;$line&#8221;;<br />done<br />&lt;/pre&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: secoif</title>
		<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/comment-page-1/#comment-7672</link>
		<dc:creator>secoif</dc:creator>
		<pubDate>Thu, 22 Jan 2009 09:19:51 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-7672</guid>
		<description>One way to merge two arrays:&lt;br&gt;&lt;br&gt;#existing array&lt;br&gt;existing=(item1, item2, item3);&lt;br&gt;&lt;br&gt;#items to merge (including an item requiring correct quoting)&lt;br&gt;merge=(item4 item5 &quot;${item6}*&quot;);&lt;br&gt;&lt;br&gt;count=${#existing[@]};&lt;br&gt;num_new_items=${#merge[@]};&lt;br&gt;# this loop appends items to the end of the array&lt;br&gt;for (( i=0;i&lt;$num_new_items;i++)); do&lt;br&gt;    echo ${i};&lt;br&gt;    existing[$count]=${merge[${i}]};&lt;br&gt;    let count+=1;&lt;br&gt;done&lt;br&gt;&lt;br&gt;count=${#existing[@]}&lt;br&gt;for (( i=0;i&lt;$count;i++)); do&lt;br&gt;    echo ${existing[${i}]};&lt;br&gt;done</description>
		<content:encoded><![CDATA[<p>One way to merge two arrays:</p>
<p>#existing array<br />existing=(item1, item2, item3);</p>
<p>#items to merge (including an item requiring correct quoting)<br />merge=(item4 item5 &#8220;${item6}*&#8221;);</p>
<p>count=${#existing[@]};<br />num_new_items=${#merge[@]};<br /># this loop appends items to the end of the array<br />for (( i=0;i&lt;$num_new_items;i++)); do<br />    echo ${i};<br />    existing[$count]=${merge[${i}]};<br />    let count+=1;<br />done</p>
<p>count=${#existing[@]}<br />for (( i=0;i&lt;$count;i++)); do<br />    echo ${existing[${i}]};<br />done</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sreeeeni</title>
		<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/comment-page-1/#comment-6876</link>
		<dc:creator>sreeeeni</dc:creator>
		<pubDate>Fri, 02 Jan 2009 05:42:07 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-6876</guid>
		<description>poda</description>
		<content:encoded><![CDATA[<p>poda</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Punit</title>
		<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/comment-page-1/#comment-6200</link>
		<dc:creator>Punit</dc:creator>
		<pubDate>Tue, 16 Dec 2008 10:01:50 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-6200</guid>
		<description>Here is another method of adding elements in the array.. It works best with korn shell&lt;br&gt;&lt;br&gt;set -A array_example 1 2 3 4 5&lt;br&gt;i=0&lt;br&gt;echo ${array_example[$i]}</description>
		<content:encoded><![CDATA[<p>Here is another method of adding elements in the array.. It works best with korn shell</p>
<p>set -A array_example 1 2 3 4 5<br />i=0<br />echo ${array_example[$i]}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Barun</title>
		<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/comment-page-1/#comment-5930</link>
		<dc:creator>Barun</dc:creator>
		<pubDate>Mon, 08 Dec 2008 07:09:04 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-5930</guid>
		<description>Wow!!! The trick for initializing an array from a file is superb!</description>
		<content:encoded><![CDATA[<p>Wow!!! The trick for initializing an array from a file is superb!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: move all array</title>
		<link>http://www.tech-recipes.com/rx/635/bash-shell-script-declaringcreating-arrays/comment-page-1/#comment-1966</link>
		<dc:creator>move all array</dc:creator>
		<pubDate>Mon, 13 Jun 2005 15:05:13 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-1966</guid>
		<description>here is another method to add elements to an array

&lt;code&gt;
for foo in $&#40;find -type f -iname &quot;*.png&quot; -printf &quot;%fn&quot;&#41;; do
  file&#91;$&#123;#file&#91;*&#93;&#125;&#93;=$foo
done
&lt;/code&gt;


will create an array of all png files</description>
		<content:encoded><![CDATA[<p>here is another method to add elements to an array</p>
<p><code><br />
for foo in $&#40;find -type f -iname &quot;*.png&quot; -printf &quot;%fn&quot;&#41;; do<br />
  file&#91;$&#123;#file&#91;*&#93;&#125;&#93;=$foo<br />
done<br />
</code></p>
<p>will create an array of all png files</p>
]]></content:encoded>
	</item>
</channel>
</rss>
