<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Bash script Array introduction]]></title><description><![CDATA[<p dir="auto">හරි මම ඔයාලට දැන් කියලා දෙනනෙ Bash script වල Array  use කරන විදිය<br />
මේ link වලින් ගිහින් ඔයාලට bash script ගැන කලින් කරපු post බලාගන්න පුලුවන්..<br />
<strong>Lets talk about bash script</strong> - <a href="https://lankadevelopers.com/topic/371/lets-talk-about-bash-script" target="_blank" rel="noopener noreferrer nofollow ugc">https://lankadevelopers.com/topic/371/lets-talk-about-bash-script</a></p>
<p dir="auto"><strong>First bash script</strong> - <a href="https://lankadevelopers.com/topic/372/first-bash-script" target="_blank" rel="noopener noreferrer nofollow ugc">https://lankadevelopers.com/topic/372/first-bash-script</a></p>
<p dir="auto"><strong>Sum of two numbers in bash script</strong> - <a href="https://lankadevelopers.com/topic/377/sum-of-two-numbers-in-bash-script" target="_blank" rel="noopener noreferrer nofollow ugc">https://lankadevelopers.com/topic/377/sum-of-two-numbers-in-bash-script</a></p>
<pre><code>#!/bin/bash

fruits=(apple orange graphes banana)
echo "${fruits[2]}" #print element 2
echo "${fruits[@]}" #print all array elements 
echo "${!fruits[@]}" #print array position 
echo "${#fruits[@]}" #calculate array size

fruits[1]=lemon #overwrite 1st element 
echo "${fruits[@]}"

fruits+=(orange) #add more value (අපිට පුලුවන් මේකෙන් array එකේ element වැඩි කරන්න)
echo "${fruits[@]}" #print all array elements
echo "${!fruits[@]}" #print array position
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1569460676277-screenshot-from-2019-09-26-06-47-45.png" alt="0_1569460696930_Screenshot from 2019-09-26 06-47-45.png" class=" img-responsive img-markdown" /></p>
]]></description><link>https://lankadevelopers.lk/topic/386/bash-script-array-introduction</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 01:07:59 GMT</lastBuildDate><atom:link href="https://lankadevelopers.lk/topic/386.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Sep 2019 01:18:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bash script Array introduction on Thu, 26 Sep 2019 23:48:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/2">@dev_lak</a>  Thank you...</p>
]]></description><link>https://lankadevelopers.lk/post/2279</link><guid isPermaLink="true">https://lankadevelopers.lk/post/2279</guid><dc:creator><![CDATA[binurayeshan]]></dc:creator><pubDate>Thu, 26 Sep 2019 23:48:22 GMT</pubDate></item><item><title><![CDATA[Reply to Bash script Array introduction on Thu, 26 Sep 2019 23:48:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/27">@root</a> Its good idea brother, thank you..</p>
]]></description><link>https://lankadevelopers.lk/post/2278</link><guid isPermaLink="true">https://lankadevelopers.lk/post/2278</guid><dc:creator><![CDATA[binurayeshan]]></dc:creator><pubDate>Thu, 26 Sep 2019 23:48:07 GMT</pubDate></item><item><title><![CDATA[Reply to Bash script Array introduction on Thu, 26 Sep 2019 16:48:19 GMT]]></title><description><![CDATA[<p dir="auto">bro can you link all bash posts together</p>
]]></description><link>https://lankadevelopers.lk/post/2277</link><guid isPermaLink="true">https://lankadevelopers.lk/post/2277</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Thu, 26 Sep 2019 16:48:19 GMT</pubDate></item><item><title><![CDATA[Reply to Bash script Array introduction on Thu, 26 Sep 2019 11:18:45 GMT]]></title><description><![CDATA[<p dir="auto">thanks bro..</p>
]]></description><link>https://lankadevelopers.lk/post/2264</link><guid isPermaLink="true">https://lankadevelopers.lk/post/2264</guid><dc:creator><![CDATA[dev_lak]]></dc:creator><pubDate>Thu, 26 Sep 2019 11:18:45 GMT</pubDate></item></channel></rss>