{"id":27914,"date":"2023-11-22T10:26:21","date_gmt":"2023-11-22T10:26:21","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=27914"},"modified":"2023-12-13T06:16:51","modified_gmt":"2023-12-13T06:16:51","slug":"elements-of-array","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/","title":{"rendered":"Elements of Bash Array"},"content":{"rendered":"<p style=\"text-align: justify;\">Working with the elements of an array in Bash is the foremost step in efficient data management using Scripts within arrays. So, this tutorial will discuss the ins and outs of the elements of an array in Bash, from accessing and modifying to even removing the elements along with Bash script development.<\/p>\n<div class=\"su-button-center\"><a href=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/practice_files_elements-of-array-bash.zip\" class=\"su-button su-button-style-default\" style=\"color:#000000;background-color:#E8F9FF;border-color:#bac8cc;border-radius:56px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#000000;padding:8px 26px;font-size:20px;line-height:30px;border-color:#effbff;border-radius:56px;text-shadow:0px 0px 0px #000000\"><i class=\"sui sui-download\" style=\"font-size:20px;color:#1AA1D6\"><\/i>  Elements of Array in Bash Practice Files<\/span><\/a><\/div>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#What_Are_the_Elements_of_Array_in_Bash\" >What Are the Elements of Array in Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Access_Array_Elements\" >Access Array Elements<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Access_an_Associative_Array_in_Bash\" >Access an Associative Array in Bash<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Access_the_Last_Array_Element_Using_a_Negative_Index\" >Access the Last Array Element Using a Negative Index<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Loop_Through_the_Elements_of_Array_in_Bash\" >Loop Through the Elements of Array in Bash<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Add_Array_Elements\" >Add Array Elements<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Add_Array_Elements_Using_Index_Assignment\" >Add Array Elements Using Index Assignment<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Modify_Array_Elements_in_Bash\" >Modify Array Elements in Bash<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Remove_Array_Elements\" >Remove Array Elements<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Extract_a_Particular_Element_from_an_Array_in_Bash\" >Extract a Particular Element from an Array in Bash<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Frequently_Asked_Question\" >Frequently Asked Question<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#How_to_create_a_Bash_array\" >How to create a Bash array?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#How_do_you_delete_all_the_elements_of_an_array_in_Bash\" >How do you delete all the elements of an array in Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#It_is_possible_to_access_the_Bash_associative_array_elements_using_the_negative_index\" >It is possible to access the Bash associative array elements using the negative index?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#How_to_get_the_number_of_elements_in_the_Bash_array\" >How to get the number of elements in the Bash array?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#Whats_the_syntax_to_access_a_specific_element_in_a_Bash_array\" >What\u2019s the syntax to access a specific element in a Bash array?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#How_do_I_loop_through_all_the_elements_in_a_Bash_array\" >How do I loop through all the elements in a Bash array?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#What_is_a_Bash_array\" >What is a Bash array?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_Are_the_Elements_of_Array_in_Bash\"><\/span>What Are the Elements of Array in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Array elements in Bash refer to the individual data values or items stored within the array and accessible through numerical indices in indexed arrays or user-defined keys in the associative arrays. Bash arrays can store data irrespective of type. It can store elements of only string type like the following array:<\/p>\n<p><code class=\"\" data-line=\"\">hello=(&quot;world&quot; &quot;universe&quot; &quot;multiverse&quot;)<\/code><\/p>\n<p>On the other hand, it stores both strings and numbers in the same array like the following:<\/p>\n<p><code class=\"\" data-line=\"\">exceptional=(10 &quot;hello&quot; 3.14)<\/code><\/p>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p style=\"text-align: justify;\"><strong>NOTE<\/strong>: Even when assigning numerical values, the Bash array stores them as strings by default. For example, the array <strong>numbers=(10 20 30 40 50)<\/strong> stores the elements <strong>&#8220;10&#8221; &#8220;20&#8221; &#8220;30&#8221; &#8220;40&#8221; &#8220;50&#8221;<\/strong> as strings and not any numeric data type. Bash doesn\u2019t practice rigidity in terms of data type so it treats elements as strings within an array.<\/p>\n<p>Thus, for any mathematical calculation, using explicit type conversion tools like <strong>&#8220;$((&#8230;))&#8221;<\/strong> or <strong>&#8220;expr&#8221;<\/strong> is recommended.<\/p>\n<\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Access_Array_Elements\"><\/span>Access Array Elements<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Accessing the array is the foremost step in working with the elements of an array in Bash. The length expressions <strong>${array_name[@]}<\/strong> and <strong>${array_name[*]}<\/strong> access the elements of array_name and print them on the screen using the <a href=\"https:\/\/linuxsimply.com\/echo-command-in-linux\/#Example_3_Using_the_echo_Command_to_View_Variables_in_the_Command_Line\" target=\"_blank\" rel=\"noopener\"><strong>echo command<\/strong><\/a> in a single line.<\/p>\n<p style=\"text-align: justify;\">Here\u2019s how to access an entire indexed array called <strong>ABC<\/strong> in Bash employing the syntax <code class=\"\" data-line=\"\">echo ${ABC[@]}<\/code> and <code class=\"\" data-line=\"\">echo ${ABC[*]}<\/code>:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Array creation\nABC=(Artcell Black CrypticFate)\n\n#printing array length to the terminal using both expressions\necho &quot;the array elements printed using \\${ABC[@]}: ${ABC[@]}&quot;\necho               # for adding extra spaces between the outputs\necho &quot;the array elements printed using \\${ABC[*]}: ${ABC[*]}&quot;\n<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>In the above code, the expressions <strong>${ABC[@]}<\/strong> and <strong>${ABC[*]}<\/strong> expand the array to access the items and print them to the screen using the <strong>echo<\/strong> command.<\/p>\n<\/div><\/div><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-27924 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/1-access-aray.png\" alt=\"accessing and printing elements\" width=\"825\" height=\"151\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/1-access-aray.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/1-access-aray-300x55.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/1-access-aray-768x141.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\"><strong>NOTE<\/strong>: The expressions above maintain a fundamental distinction though serving the same purpose. The syntax <strong>${ABC[@]}<\/strong> expands each element as a separate word preserving the integrity of the individual elements. Contrarily, <strong>${ABC[*]}<\/strong>\u00a0 concatenates all the elements into a single word separated by a space. For example, with elements \u201capple\u201d, \u201cbanana\u201d \u201corange\u201d, <strong>${ABC[*]}<\/strong> treats them as a single string <strong>\u201capple banana orange\u201d<\/strong>.<\/div><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Access_an_Associative_Array_in_Bash\"><\/span>Access an Associative Array in Bash<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To access the elements of an associative array in bash, use the same syntaxes <strong>echo ${assoc_array[@]}<\/strong> and <strong>echo ${assoc_array[*]}<\/strong>. However, it only prints the values associated with the keys. Here\u2019s an example:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#declare an associative array and assign values\ndeclare -A my_associative\nmy_associative[&quot;eat&quot;]=&quot;rice&quot;\nmy_associative[&quot;take&quot;]=&quot;tea&quot;\nmy_associative[&quot;drink&quot;]=&quot;juice&quot;\n\n#printing the array \necho ${my_associative[@]}\n<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>Here, the <code class=\"\" data-line=\"\">${my_associative[@]}<\/code> expression accesses an associative array named <strong>my_associative <\/strong>with 3 key-value pairs. Finally, the command <code class=\"\" data-line=\"\">echo ${my_associative[@]}<\/code> prints only the array values on the screen.<\/p>\n<\/div><\/div><img decoding=\"async\" class=\"aligncenter wp-image-27925 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/2-access-assoc-array.png\" alt=\"access bash associative array elements\" width=\"576\" height=\"140\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/2-access-assoc-array.png 576w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/2-access-assoc-array-300x73.png 300w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p style=\"text-align: justify;\"><strong>NOTE<\/strong>: You can also access specific elements of the <strong>indexed array<\/strong> and <strong>associative array<\/strong> in Bash. To learn more, read the articles: <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/index-array\/#Print_Specific_Elements_of_an_Indexed_Array\" target=\"_blank\" rel=\"noopener\"><strong>Index Array in Bash<\/strong><\/a> and <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/associative-array\/#Print_Specific_Elements_of_an_Associative_Array\" target=\"_blank\" rel=\"noopener\"><strong>Bash Associative Arrays<\/strong><\/a><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Access_the_Last_Array_Element_Using_a_Negative_Index\"><\/span>Access the Last Array Element Using a Negative Index<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Bash arrays can elegantly use the negative index to access the last element. Instead of counting from the start, negative indices count backward from the end of the array. For instance, <strong>-1<\/strong> refers to the last element, <strong>-2<\/strong> refers to the second last item, and so on. Thus, using the index assignment syntax with &#8220;-1&#8221;, <strong>${your_array[-1]}<\/strong>, returns the last element and the echo command prints the value on the terminal.<\/p>\n<p style=\"text-align: justify;\">To access the last element of an indexed array, you can use the syntax, <strong>echo ${your_array[-1]}<\/strong>, like the following example:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# the array \nshoes=(adidas puma nike)\n\n#print array\necho &quot;all items: ${shoes[@]}&quot;\n\necho \n\n# print last item\necho \u201clast item:${shoes[-1]}\n<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>Here, the expression <code class=\"\" data-line=\"\">${shoes[-1]}<\/code> accesses the last element <strong>nike <\/strong>of the array <strong>shoes <\/strong>using the negative index <strong>\u2018-1\u2019<\/strong> and the <code class=\"\" data-line=\"\">echo &quot;last item:${shoes[-1]}&quot;<\/code> command prints the value <strong>nike<\/strong> on the screen.<\/p>\n<\/div><\/div><img decoding=\"async\" class=\"aligncenter wp-image-27926 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/3-last-item.png\" alt=\"access last element using negative index\" width=\"825\" height=\"203\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/3-last-item.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/3-last-item-300x74.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/3-last-item-768x189.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Loop_Through_the_Elements_of_Array_in_Bash\"><\/span>Loop Through the Elements of Array in Bash<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Using Bash loop-based methods are general approach to iterate over an array. To loop through the Bash array elements using <strong>for<\/strong> loop with the syntax <strong>for elem in ${array[@]}<\/strong>, see the example below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Declaring an indexed array and assigning it with values \nfruit=(lichie pine orange)\n\n#looping through the elements to print \nfor item in ${fruit[@]}\n    do\n        echo $item\ndone \n<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>First, the complete looping expression <code class=\"\" data-line=\"\">for elements in ${fruit[@]}<\/code> iterates through the <strong>fruit<\/strong> array until it covers the entire array length <strong>(which is 3)<\/strong> and prints the items into the terminal iteratively on new lines using <code class=\"\" data-line=\"\">echo $item<\/code>.<\/p>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-27927 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/4-loopelems.png\" alt=\"loop through the bash array elements\" width=\"570\" height=\"208\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/4-loopelems.png 570w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/4-loopelems-300x109.png 300w\" sizes=\"(max-width: 570px) 100vw, 570px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Add_Array_Elements\"><\/span>Add Array Elements<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Adding a new element in an array is very simple in Bash. Use the <strong>=+<\/strong> operator with the syntax <strong>array_name+=(element to add)<\/strong>. By default, it adds an element to the end of the specified array.<\/p>\n<p style=\"text-align: justify;\">Here\u2019s an example to add an array element <strong>CSE<\/strong> in an indexed array named <strong>dept<\/strong> using syntax <code class=\"\" data-line=\"\">dept+=(CSE)<\/code>:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#array declaration with elements \ndept=(EEE CE)\n\n#print array before append\necho &quot;before: ${dept[@]}&quot;\n\n#append element\ndept+=(CSE)\n\n#print array after append\necho &quot;after adding new element: ${dept[@]}&quot;\n<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">This script uses the syntax\u00a0 <strong>dept+=(CSE)<\/strong> to add a new element <strong>CSE<\/strong> to the end of the <strong>dept<\/strong> array with 2 elements. The final <strong>echo<\/strong> command prints the array with 3 elements <strong>(EEE CE CSE)<\/strong>.<\/p>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-27928 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/5-addelem1.png\" alt=\"adding new elements \" width=\"700\" height=\"144\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/5-addelem1.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/5-addelem1-300x62.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>The snap above shows that the <strong>dept+=(CSE)<\/strong> expression adds a new element to the array dept which is evident after printing the array in the last line.<\/p>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p><strong>NOTE<\/strong>: To add multiple elements to an array, use <strong>array+=(item1 item2 ..ItemN)<\/strong>. For instance, to add <strong>MME<\/strong> and <strong>ECE<\/strong> to the above array, the syntax is: <code class=\"\" data-line=\"\">dept+=(MME ECE)<\/code><\/div><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Add_Array_Elements_Using_Index_Assignment\"><\/span>Add Array Elements Using Index Assignment<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The index assignment syntax <strong>array_name[index]=element<\/strong> adds a new element to an existing Bash array in any specified index.<\/p>\n<p style=\"text-align: justify;\">I\u2019ll use the same dept array to add 2 new elements <strong>Arch<\/strong> and <strong>CEE<\/strong> at index 2 and index 10 using the index assignment syntaxes <code class=\"\" data-line=\"\">dept[2]=Arch<\/code> and <code class=\"\" data-line=\"\">dept[10]=CEE<\/code>. Here\u2019s how:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#array declaration with elements \ndept=(EEE CE)\n\n#print array before append\necho &quot;before: ${dept[@]}&quot;\n\n#append element\ndept[2]=Arch\ndept[10]=CEE\n\n#print array after append\necho &quot;after adding new elements: ${dept[@]}&quot;\n\n#print index\necho &quot;the indices are: ${!dept[@]}&quot;\n<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">In this script, the <strong>dept[2]=Arch<\/strong> add a new element <strong>Arch<\/strong> to the <strong>dept<\/strong> array at the 3rd position. The <strong>dept[10]=CEE <\/strong>expression adds <strong>CEE<\/strong> to the array in the 4th position but with index number 10. The <strong>echo<\/strong> command prints the array and all the indices to verify the successful running of operations using <code class=\"\" data-line=\"\">echo &quot;after adding new elements: ${dept[@]}&quot;<\/code> and <code class=\"\" data-line=\"\">echo &quot;the indices are ${!dept[@]}&quot;<\/code><\/p>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-27929 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/6-addelem2.png\" alt=\"adding elements of array using index assignment\" width=\"825\" height=\"169\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/6-addelem2.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/6-addelem2-300x61.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/6-addelem2-768x157.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>Here, you can see that the assignment expression above adds 2 new elements <strong>(Arch CEE)<\/strong> to the <strong>dept <\/strong>array both in a contiguous manner<strong> (index 2)<\/strong> and in a random manner <strong>(index 10)<\/strong>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Modify_Array_Elements_in_Bash\"><\/span>Modify Array Elements in Bash<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To modify an array element is to replace the extant value with a new value in the same position. The syntax\u00a0<strong>array[index]= new_value<\/strong>modifies the array element by updating with the <strong>new_value<\/strong> at the specified <strong>index<\/strong>. Here\u2019s an example:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash  \n#Declaring the array  \nhello=(&quot;i&quot; &quot;am&quot; &quot;kohli&quot;)  \n\n#Printing all the elements of the Array  \necho &quot;before:${hello[@]}&quot;\n\n#Updating the Array Element  \nhello[2]=williamson  \n  \n#Printing all the elements of the Array  \necho &quot;after modification:${hello[@]}&quot;\n<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>Here, the <code class=\"\" data-line=\"\">hello[2]=williamson<\/code> expression updates the content of index 2 (3rd position) from kohli to williamson. The<code class=\"\" data-line=\"\"> echo &quot;after modification:${hello[@]}&quot;<\/code> command prints the array with the updated contents.<\/p>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-27930 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/7-modify-elem.png\" alt=\"modify the array values\" width=\"700\" height=\"150\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/7-modify-elem.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/7-modify-elem-300x64.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>Terminal output to modify the array element from <strong>kohli to williamson<\/strong>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Remove_Array_Elements\"><\/span>Remove Array Elements<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">To delete an array element, use the unset command followed by the index value like the format: <code class=\"\" data-line=\"\">unset array_name[index]<\/code><\/p>\n<p>Here\u2019s an example to show how to remove an element from an indexed array:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#create an indexed array\njuice=(&quot;apple&quot; &quot;banana&quot; &quot;cherry&quot; &quot;date&quot; &quot;kiwi&quot;)\n\n#print the entire array\necho ${juice[@]}\n\necho\n\n#remove the element banana\nunset juice[1]\n\n#print array again\necho ${juice[@]}\n<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">In the script, the <code class=\"\" data-line=\"\">unset juice[1]<\/code> command removes the 2nd element <strong>banana<\/strong>. After that, the <strong>echo<\/strong> command prints the array twice to show that the unset command has removed the array element.<\/p>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-27931 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/8-remove-Elem.png\" alt=\"removing array element using unset command\" width=\"682\" height=\"160\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/8-remove-Elem.png 682w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/8-remove-Elem-300x70.png 300w\" sizes=\"(max-width: 682px) 100vw, 682px\" \/>In the above, the <strong>unset<\/strong> command removes the element banana from the array juice.<\/p>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p style=\"text-align: justify;\"><strong>NOTE<\/strong>: To learn how to add, remove, and modify elements to a Bash associative array, read the article: <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/associative-array\/#Append_Elements_to_an_Associative_Array\"><strong>\u201cBash Associative Arrays\u201d<\/strong><\/a><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Extract_a_Particular_Element_from_an_Array_in_Bash\"><\/span>Extract a Particular Element from an Array in Bash<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">You can extract a specific part of an array element in Bash of string type. Take the array <strong>sen=(&#8216;howdy parallel universe monster!&#8217; &#8216;storm is coming&#8217; &#8216;world cup ends&#8217;)<\/strong> for instance. If you want to extract words from the 1st element<strong> (&#8216;howdy parallel universe monster!&#8217;)<\/strong>, you can use modifiers in variable expansion like the below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#create the array\nsen=(&#039;howdy parallel universe monster!&#039; &#039;storm is coming&#039; &#039;world cup ends&#039;)\n\n#the array\necho &quot;the array: ${sen[@]}&quot;\n\n# to get the first element\necho &quot;1st element: ${sen[0]}&quot;\n\n#to get the last word \u201cmonster!\u201d, remove prefix through the last space using ##*\necho &quot;last word: ${sen[0]##* }&quot;\n\n#To get the first word, remove suffix starting with the first space using %% *\necho &quot;1st word: ${sen[0]%% *}&quot;\n\n#The second word is harder; first remove through the first space\ntmp=&quot;${sen[0]#* }&quot;\n#then get the first word of what remains\necho &quot;2nd word: ${tmp%% *}&quot;\n\n# The third word (which might not be the last)? remove through the second space\ntmp2=&quot;${sen[0]#* * }&quot;\n# ...then the first word again\necho &quot;3rd word: ${tmp2%% *}&quot;\n<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>Here, in the provided code:<\/p>\n<p><code class=\"\" data-line=\"\">${sen[0]##* }<\/code>: Prints the last word of the first array element by removing everything before the last space.<\/p>\n<p><code class=\"\" data-line=\"\">${sen[0]%% *}<\/code>: Prints the first word of the first array element by removing everything after the first space.<\/p>\n<p><code class=\"\" data-line=\"\">${sen[0]#* }<\/code>: Extracts the words after the first space, and `${tmp%% *}` prints the first word from this extracted section.<\/p>\n<p><code class=\"\" data-line=\"\">${sen[0]#* * }<\/code>: Extracts the words after the second space, and `${tmp2%% *}` prints the first word from this extracted section.<\/p>\n<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-27932 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/9-extraction.png\" alt=\"extract particular array element\" width=\"825\" height=\"215\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/9-extraction.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/9-extraction-300x78.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/9-extraction-768x200.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>The above image states that the variable expansion has extracted elements (words) from the 1st array element (sentence).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In closing, this tutorial has discussed the intricacies of elements of arrays in Bash from accessing elements to manipulating them dynamically showing several hands-on illustrations. I hope this article empowers your scriptwriting capabilities in terms of efficient data handling and fosters elegant solution-building by mastering array fundamentals. <strong>Happy Scripting!<\/strong><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_Asked_Question\"><\/span>Frequently Asked Question<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"How_to_create_a_Bash_array\"><\/span>How to create a Bash array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To create a Bash array:<\/p>\n<ol>\n<li>Use the syntax <strong>declare -a &lt;array_name&gt;<\/strong> to create an empty array.<\/li>\n<li>To create an array with initialized elements use: <strong>array_name=(element1 element2.. elementN)<\/strong>.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"How_do_you_delete_all_the_elements_of_an_array_in_Bash\"><\/span>How do you delete all the elements of an array in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Use the <strong>unset<\/strong> command followed by the array name to delete all the elements of an array in Bash. For example, to delete elements of an array named <strong>numbers<\/strong>, use: <code class=\"\" data-line=\"\">unset numbers<\/code>.<\/p>\n<p><strong>OR,<\/strong><\/p>\n<p style=\"text-align: justify;\">You can recreate the same array using <strong>array_name=()<\/strong> or <strong>declare -a array_name<\/strong>. For instance, to delete all elements of the array <strong>numbers<\/strong> use the syntax: <code class=\"\" data-line=\"\">declare -a numbers=()<\/code> or <code class=\"\" data-line=\"\">numbers=()<\/code><\/p>\n<h3><span class=\"ez-toc-section\" id=\"It_is_possible_to_access_the_Bash_associative_array_elements_using_the_negative_index\"><\/span>It is possible to access the Bash associative array elements using the negative index?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><strong>No<\/strong>, since Bash associative arrays don\u2019t support negative indices to access elements. Rather, it uses a unique set of keys that are not maintained in any sequential order. A negative index is only an attribute available to the regular indexed arrays in Bash.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_get_the_number_of_elements_in_the_Bash_array\"><\/span>How to get the number of elements in the Bash array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The number of elements of a Bash array is the length of that array. To get the length of an array in Bash, use the expression <strong>${#your_array[@])<\/strong> with the <strong>echo<\/strong> command. For instance, if you have an array <strong>nums=(1 2 3)<\/strong> which you intend to get the length of, then use the syntax <code class=\"\" data-line=\"\">echo ${#nums[@]}<\/code>. It will return <strong>3<\/strong> as the output on the terminal.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Whats_the_syntax_to_access_a_specific_element_in_a_Bash_array\"><\/span>What\u2019s the syntax to access a specific element in a Bash array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To access any specific element in a Bash array, use the syntax <strong>${your_array[index]}<\/strong>, where <strong>index <\/strong>is the position of the element you want to access. For instance, the syntax <strong>echo ${number[0]}<\/strong> prints the first element of the array <strong>number<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_loop_through_all_the_elements_in_a_Bash_array\"><\/span>How do I loop through all the elements in a Bash array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To loop through all the elements in a Bash array use the Bash for loop syntax <strong>for elem in ${array[@]}<\/strong> to iterate over the entire array. For example, to iterate over the array <strong>number=(1 2 3 4)<\/strong>, the syntax is:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">for digit in ${number[@]}\n    do\n        echo $digit\ndone <\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>1<\/p>\n<p>2<\/p>\n<p>3<\/p>\n<p>4<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_is_a_Bash_array\"><\/span>What is a Bash array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">A <strong>Bash array<\/strong> is a data structure that stores values in an indexed way. Unlike arrays in other programming languages, bash array can store different types of elements. For example, you can use Bash arrays to store both strings and numbers.<\/p>\n<p><script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [{\n    \"@type\": \"Question\",\n    \"name\": \"How do you delete all the elements of an array in Bash?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"Use the unset command followed by the array name to delete all the elements of an array in Bash. For example, to delete elements of an array named numbers, use: unset numbers.<\/p>\n<p>Or<\/p>\n<p>You can recreate the same array using array_name=() or declare -a array_name. For instance, to delete all elements of the array numbers use the syntax: declare -a numbers=() or numbers=()\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"It is possible to access the Bash associative array elements using the negative index?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"No, since Bash associative arrays don\u2019t support negative indices to access elements. Rather, it uses a unique set of keys that are not maintained in any sequential order. A negative index is only an attribute available to the regular indexed arrays in Bash.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How to get the number of elements in the Bash array?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"The number of elements of a Bash array is the length of that array. To get the length of an array in Bash, use the expression ${#your_array[@]) with the echo command. For instance, if you have an array nums=(1 2 3) which you intend to get the length of, then use the syntax echo ${#nums[@]}. It will return 3 as the output on the terminal.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What\u2019s the syntax to access a specific element in a Bash array?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To access any specific element in a Bash array, use the syntax ${your_array[index]}, where index is the position of the element you want to access. For instance, the syntax echo ${number[0]} prints the first element of the array number.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What is a Bash array?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"A Bash array is a data structure that stores values in an indexed way. Unlike arrays in other programming languages, bash array can store different types of elements. For example, you can use Bash arrays to store both strings and numbers.\"\n    }\n  }]\n}\n<\/script><\/p>\n<p><span style=\"font-size: 18pt; color: #003366;\"><strong>Related Articles<\/strong><\/span><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/iterate-array\/\" target=\"_blank\" rel=\"noopener\">3 Ways to Iterate an Array in Bash<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/array-contains\/\" target=\"_blank\" rel=\"noopener\">Check If Bash Array Contains [Letters, Numbers, or Values]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<p><strong>&lt;&lt; Go Back to <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Array&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/\" target=\"_blank\" rel=\"noopener\">Bash Array<\/a><\/span> | <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Scripting Tutorial&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\" target=\"_blank\" rel=\"noopener\">Bash Scripting Tutorial<\/a><\/span><\/strong><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;27914&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;9&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;3.4&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;3.4\\\/5 - (9 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Elements of Bash Array&quot;,&quot;width&quot;:&quot;96.1&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 96.1px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            3.4\/5 - (9 votes)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Working with the elements of an array in Bash is the foremost step in efficient data management using Scripts within &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Elements of Bash Array\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#more-27914\" aria-label=\"Read more about Elements of Bash Array\">Read more<\/a><\/p>\n","protected":false},"author":314910,"featured_media":27933,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[178],"class_list":["post-27914","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-bash-array","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Elements of Bash Array<\/title>\n<meta name=\"description\" content=\"In this article, you will learn about different methods to working with the elements of array in Bash from accessing to removing elements.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Elements of Bash Array\" \/>\n<meta property=\"og:description\" content=\"In this article, you will learn about different methods to working with the elements of array in Bash from accessing to removing elements.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prem.masrur\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-22T10:26:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-13T06:16:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/10-elements-of-array-feature-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Md Masrur Ul Alam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Md Masrur Ul Alam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/\"},\"author\":{\"name\":\"Md Masrur Ul Alam\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/64033dc86d4cd3b6a549cd0ae9e73423\"},\"headline\":\"Elements of Bash Array\",\"datePublished\":\"2023-11-22T10:26:21+00:00\",\"dateModified\":\"2023-12-13T06:16:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/\"},\"wordCount\":1956,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/10-elements-of-array-feature-image.png\",\"keywords\":[\"bash array\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/\",\"name\":\"Elements of Bash Array\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/10-elements-of-array-feature-image.png\",\"datePublished\":\"2023-11-22T10:26:21+00:00\",\"dateModified\":\"2023-12-13T06:16:51+00:00\",\"description\":\"In this article, you will learn about different methods to working with the elements of array in Bash from accessing to removing elements.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/10-elements-of-array-feature-image.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/10-elements-of-array-feature-image.png\",\"width\":400,\"height\":400,\"caption\":\"feature image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/elements-of-array\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bash Scripting Tutorial\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"A Complete Guide to Bash Array\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Elements of Bash Array\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/64033dc86d4cd3b6a549cd0ae9e73423\",\"name\":\"Md Masrur Ul Alam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Md-Masrur-Ul-Alam-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Md-Masrur-Ul-Alam-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Md-Masrur-Ul-Alam-II-96x96.png\",\"caption\":\"Md Masrur Ul Alam\"},\"description\":\"Assalamu Alaikum, I\u2019m Md Masrur Ul Alam, currently working as a Linux OS Content Developer Executive at SOFTEKO. I completed my Bachelor's degree in Electronics and Communication Engineering (ECE)from Khulna University of Engineering &amp; Technology (KUET). With an inquisitive mind, I have always had a keen eye for Science and Technolgy based research and education. I strongly hope this entity leverages the success of my effort in developing engaging yet seasoned content on Linux and contributing to the wealth of technical knowledge. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/prem.masrur\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/masrur-alam\\\/\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/masrur\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Elements of Bash Array","description":"In this article, you will learn about different methods to working with the elements of array in Bash from accessing to removing elements.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/","og_locale":"en_US","og_type":"article","og_title":"Elements of Bash Array","og_description":"In this article, you will learn about different methods to working with the elements of array in Bash from accessing to removing elements.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/prem.masrur\/","article_published_time":"2023-11-22T10:26:21+00:00","article_modified_time":"2023-12-13T06:16:51+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/10-elements-of-array-feature-image.png","type":"image\/png"}],"author":"Md Masrur Ul Alam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Md Masrur Ul Alam","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/"},"author":{"name":"Md Masrur Ul Alam","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/64033dc86d4cd3b6a549cd0ae9e73423"},"headline":"Elements of Bash Array","datePublished":"2023-11-22T10:26:21+00:00","dateModified":"2023-12-13T06:16:51+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/"},"wordCount":1956,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/10-elements-of-array-feature-image.png","keywords":["bash array"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/","name":"Elements of Bash Array","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/10-elements-of-array-feature-image.png","datePublished":"2023-11-22T10:26:21+00:00","dateModified":"2023-12-13T06:16:51+00:00","description":"In this article, you will learn about different methods to working with the elements of array in Bash from accessing to removing elements.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/10-elements-of-array-feature-image.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/10-elements-of-array-feature-image.png","width":400,"height":400,"caption":"feature image"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"Bash Scripting Tutorial","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/"},{"@type":"ListItem","position":3,"name":"A Complete Guide to Bash Array","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/"},{"@type":"ListItem","position":4,"name":"Elements of Bash Array"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/64033dc86d4cd3b6a549cd0ae9e73423","name":"Md Masrur Ul Alam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Md-Masrur-Ul-Alam-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Md-Masrur-Ul-Alam-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Md-Masrur-Ul-Alam-II-96x96.png","caption":"Md Masrur Ul Alam"},"description":"Assalamu Alaikum, I\u2019m Md Masrur Ul Alam, currently working as a Linux OS Content Developer Executive at SOFTEKO. I completed my Bachelor's degree in Electronics and Communication Engineering (ECE)from Khulna University of Engineering &amp; Technology (KUET). With an inquisitive mind, I have always had a keen eye for Science and Technolgy based research and education. I strongly hope this entity leverages the success of my effort in developing engaging yet seasoned content on Linux and contributing to the wealth of technical knowledge. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/prem.masrur\/","https:\/\/www.linkedin.com\/in\/masrur-alam\/"],"url":"https:\/\/linuxsimply.com\/author\/masrur\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/27914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314910"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=27914"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/27914\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/27933"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=27914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=27914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=27914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}