{"id":37437,"date":"2024-02-22T05:59:51","date_gmt":"2024-02-22T05:59:51","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=37437"},"modified":"2024-03-17T03:18:09","modified_gmt":"2024-03-17T03:18:09","slug":"bash-json-to-array","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/","title":{"rendered":"How to Convert a JSON Array into Bash Array [5 Methods]"},"content":{"rendered":"<p>You can use the following methods to convert a JSON array into a Bash array:<\/p>\n<ol>\n<li>Using <strong>jq<\/strong> with command substitution: <code class=\"\" data-line=\"\">array=($(echo &quot;$json_arr&quot; | jq -r &#039;.[]&#039;))<\/code><\/li>\n<li>Using <strong>mapfile<\/strong> command: <code class=\"\" data-line=\"\">mapfile -t array &lt; &lt;(echo &quot;$json_arr&quot; | jq -r &#039;.[]&#039;)<\/code><\/li>\n<li>Using <strong>readarray<\/strong> command: <code class=\"\" data-line=\"\">readarray -t array &lt; &lt;(echo &quot;$json_arr&quot; | jq -r &#039;.[]&#039;)<\/code><\/li>\n<li>Using <strong>for<\/strong> loop: <code class=\"\" data-line=\"\">for item in $(echo &quot;$json_arr&quot; | jq -r &#039;.[]&#039;); do<\/code><br \/>\n<code class=\"\" data-line=\"\">array+=(&quot;$item&quot;); done<\/code><\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><strong>JSON (JavaScript Object Notation)<\/strong> is a powerful and lightweight tool that allows for the interchanging of data format that is easy for humans to read and for machines to parse using data structure formats such as arrays. Thus, the conversion of JSON arrays to Bash arrays might become a necessary step in processing and manipulating data within Bash scripts. This article will show 5 methods on how to <strong>convert JSON arrays to Bash arrays<\/strong> mentioning command and loop-based methods. It will also discuss challenges that may arise during the conversion operation with effective solutions.<\/p>\n<div class=\"su-button-center\"><a href=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/bash-json-to-array-practice-files.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>  Bash JSON to array 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\/array-operations\/json-to-array\/#1_Using_the_%E2%80%9Cjq%E2%80%9D_Command_with_Command_Substitution\" >1. Using the \u201cjq\u201d Command with Command Substitution<\/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\/array-operations\/json-to-array\/#2_Using_the_%E2%80%9Cmapfile%E2%80%9D_Command\" >2.\u00a0 Using the \u201cmapfile\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#3_Using_the_%E2%80%9Creadarray%E2%80%9D_Command\" >3. Using the \u201creadarray\u201d Command<\/a><\/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\/array-operations\/json-to-array\/#4_Using_the_%E2%80%9Cread%E2%80%9D_Command_with_%E2%80%98jq\" >4. Using the \u201cread\u201d Command with \u2018jq\u2019<\/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\/array-operations\/json-to-array\/#5_Using_%E2%80%9Cfor%E2%80%9D_Loop\" >5. Using \u201cfor\u201d Loop<\/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\/array-operations\/json-to-array\/#How_to_Read_JSON_Array_from_File_to_Convert_into_Bash_Array\" >How to Read JSON Array from File to Convert into Bash Array<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#How_to_Solve_%E2%80%9Cjq_command_not_found%E2%80%9D_Error\" >How to Solve \u201cjq command not found\u201d Error<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#Solution_Install_the_%E2%80%9Cjq%E2%80%9D_Command_Using_%E2%80%9Csudo_apt-get_install%E2%80%9D\" >Solution: Install the \u201cjq\u201d Command Using \u201csudo apt-get install\u201d<\/a><\/li><\/ul><\/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\/array-operations\/json-to-array\/#Conclusion\" >Conclusion<\/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\/array-operations\/json-to-array\/#People_Also_Ask\" >People Also Ask<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#How_to_convert_a_JSON_array_into_a_Bash_array\" >How to convert a JSON array into a Bash array?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#How_to_install_the_jq_command_in_my_Ubuntu_system\" >How to install the jq command in my Ubuntu system?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#Can_I_access_specific_elements_of_JSON_array_in_Bash\" >Can I access specific elements of JSON array in Bash?<\/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\/array-operations\/json-to-array\/#What_does_the_jq_command_do_in_converting_JSON_arrays_to_Bash_arrays\" >What does the jq command do in converting JSON arrays to Bash arrays?<\/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\/array-operations\/json-to-array\/#What_is_the_jq_command_in_Linux\" >What is the jq command in Linux?<\/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\/array-operations\/json-to-array\/#What_is_a_JSON_array\" >What is a JSON array?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1_Using_the_%E2%80%9Cjq%E2%80%9D_Command_with_Command_Substitution\"><\/span>1. Using the \u201cjq\u201d Command with Command Substitution<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The jq command is a command line-based JSON data processor that is capable of extracting the elements from a JSON array and can be converted into a <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/\" target=\"_blank\" rel=\"noopener\"><strong>Bash array<\/strong><\/a> with command substitution. The full syntax is <code class=\"\" data-line=\"\">array=($(echo &quot;$json_array&quot; | jq -r &#039;.[]&#039;))<\/code>. Here\u2019s an example:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n# the json array \njson_array=&#039;[&quot;item1&quot;, &quot;item2&quot;, &quot;item3&quot;]&#039;\n#converting to bash array\nbash_array=($(echo &quot;$json_array&quot; | jq -r &#039;.[]&#039;))\n\n#print the array and length\necho &quot;array: ${bash_array[@]}&quot;\necho &quot;length: ${#bash_array[@]}&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>The above code first initializes a variable called <strong>json_array<\/strong> containing a JSON array as a string. Then <code class=\"\" data-line=\"\">echo &quot;$json_array&quot;<\/code> prints the JSON array string and the output is piped to the &#8220;jq&#8221; command. The &#8220;jq&#8221; command extracts each array element <strong>(<\/strong>item1 item2 item3<strong>)<\/strong> and <strong>-r<\/strong> flag outputs them without the quotes. Finally, the command substitution method within the syntax <code class=\"\" data-line=\"\">bash_array=($(echo &quot;$json_array&quot; | jq -r &#039;.[]&#039;))<\/code> extracts the elements into the bash_array which is evident after printing the <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/elements-of-array\/\" target=\"_blank\" rel=\"noopener\"><strong>elements of the Bash array<\/strong><\/a> using the <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/output\/echo-command\/\" target=\"_blank\" rel=\"noopener\"><strong>echo command<\/strong><\/a> along with its length.\u00a0 <\/div><\/div><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-37439\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1-jq-to-bash.png\" alt=\"bash json to aray using jq command\" width=\"825\" height=\"178\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1-jq-to-bash.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1-jq-to-bash-300x65.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1-jq-to-bash-768x166.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"2_Using_the_%E2%80%9Cmapfile%E2%80%9D_Command\"><\/span>2.\u00a0 Using the \u201cmapfile\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The <strong>mapfile<\/strong> command is a powerful tool that allows reading lines from a standard input into an array variable. Here, the &#8220;mapfile&#8221; command can take a JSON array processed by the &#8220;jq&#8221; command as its input and convert it into an array variable. Here\u2019s how:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n# the json array \njson_array=&#039;[&quot;item1&quot;, &quot;item2&quot;, &quot;item3&quot;]&#039;\n#converting to bash array with mapfile and jq\nmapfile -t bash_array &lt; &lt;(echo &quot;$json_array&quot; | jq -r &#039;.[]&#039;)\n\n#print the array and length\necho &quot;array: ${bash_array[@]}&quot;\necho &quot;length: ${#bash_array[@]}&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 script, the code <code class=\"\" data-line=\"\">echo &quot;$json_array&quot;<\/code> print the JSON array and <code class=\"\" data-line=\"\">jq -r &#039;.[]&#039;<\/code> command extracts each element using the<strong> .[]<\/strong> filter. Then the mapfile command reads lines from its standard input <strong>(<\/strong>the output of the jq command in this case<strong>)<\/strong> to the array variable called <strong>bash_array<\/strong>. Finally, the <strong>echo<\/strong> command prints the array items and length to verify the conversion operation. <\/div><\/div><img decoding=\"async\" class=\"aligncenter size-full wp-image-37440\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2-mapfile-json-to-array.png\" alt=\"bash json to array with mapfile\" width=\"825\" height=\"147\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2-mapfile-json-to-array.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2-mapfile-json-to-array-300x53.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2-mapfile-json-to-array-768x137.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Using_the_%E2%80%9Creadarray%E2%80%9D_Command\"><\/span>3. Using the \u201creadarray\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The <strong>readarray<\/strong> command is sometimes interchangeable with the <strong>mapfile<\/strong> command in Linux\/Unix. It is an effective tool to take JSON array as input and convert it into a Bash array. Look at the following example to convert a JSON array into an array in Bash using the &#8220;readarray&#8221; command:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n# the json array \njson_array=&#039;[&quot;item1&quot;, &quot;item2&quot;, &quot;item3&quot;]&#039;\n\n#converting to bash array with readarray and jq\nreadarray -t bash_array &lt;&lt;&lt; &quot;$(echo &quot;$json_array&quot; | jq -r &#039;.[]&#039;)&quot;\n\n#print the array and length\necho &quot;array: ${bash_array[@]}&quot;\necho &quot;length: ${#bash_array[@]}&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 script, the code<code class=\"\" data-line=\"\"> echo &quot;$json_array&quot;<\/code> print the JSON array and <code class=\"\" data-line=\"\">jq -r &#039;.[]&#039;<\/code> command extracts each element using the <strong>.[]<\/strong> filter. Finally, the &#8220;readarray&#8221; command reads lines from its standard input <strong>(<\/strong>the output of the jq command in this case<strong>)<\/strong> to the array variable called <strong>bash_array<\/strong> which is seen after printing the array elements<strong> (<\/strong>item1 item2 item3<strong>)<\/strong> and its length<strong> (<\/strong>3<strong>)<\/strong> using the &#8220;echo&#8221; command. <\/div><\/div><img decoding=\"async\" class=\"aligncenter size-full wp-image-37441\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3-readarrayJSON.png\" alt=\"readarray command to converts json array to bash array\" width=\"825\" height=\"179\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3-readarrayJSON.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3-readarrayJSON-300x65.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3-readarrayJSON-768x167.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_Using_the_%E2%80%9Cread%E2%80%9D_Command_with_%E2%80%98jq\"><\/span>4. Using the \u201cread\u201d Command with \u2018jq\u2019<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The <strong>read<\/strong> command with the lightweight JSON processing tool &#8220;jq&#8221; can effectively convert a JSON array into a Bash array. Here&#8217;s an example:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n# the json array \njson_array=&#039;[&quot;hello&quot;, &quot;world&quot;, &quot;universe&quot;, &quot;multiverse&quot;]&#039;\n\n# declaring an empty bash array\nbash_array=()\n# read command to take json array items to bash array\nwhile read -r item; do\n    bash_array+=(&quot;$item&quot;)\ndone &lt; &lt;(echo &quot;$json_array&quot; | jq -r &#039;.[]&#039;)\n#print the array and length\necho &quot;array: ${bash_array[@]}&quot;\necho &quot;length: ${#bash_array[@]}&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>The above code initializes a JSON array and an empty bash array afterward. Then the <strong>read<\/strong> command with the <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/\" target=\"_blank\" rel=\"noopener\"><strong>while loop<\/strong><\/a> reads each line of input from the <strong>jq<\/strong> command output and assigns them to <strong>item<\/strong> variable. With each ongoing iteration, the items are appended to the <strong>bash_array<\/strong> which is evident after printing the array elements and length.<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-37443\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4-j2arr-read.png\" alt=\"bash json to array with read command\" width=\"825\" height=\"142\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4-j2arr-read.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4-j2arr-read-300x52.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4-j2arr-read-768x132.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"5_Using_%E2%80%9Cfor%E2%80%9D_Loop\"><\/span>5. Using \u201cfor\u201d Loop<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/for-loop\/\" target=\"_blank\" rel=\"noopener\"><strong>Bash for loop<\/strong><\/a> can iteratively process the output of the &#8220;jq&#8221; command and convert the JSON array into a Bash array like the following example:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# JSON array\njson_array=&#039;[&quot;virat&quot;, &quot;tamim&quot;, &quot;ross&quot;]&#039;\n\n# Initialize empty Bash array\ndeclare -a bash_array\n\n# Iterate over JSON array elements and append them to the Bash array\nfor item in $(echo &quot;$json_array&quot; | jq -r &#039;.[]&#039;); do\n    bash_array+=(&quot;$item&quot;)\ndone\n# Print Bash array elements and length\necho &quot;array: ${bash_array[@]}&quot;\necho &quot;length: ${#bash_array[@]}&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>The above code uses the loop <code class=\"\" data-line=\"\">for item in $(echo &quot;$json_array&quot; | jq -r &#039;.[]&#039;)<\/code> to iterate over each output of the &#8220;jq&#8221; command and appends them to a basha array using<code class=\"\" data-line=\"\"> bash_array+=(&quot;$item&quot;)<\/code> where the variable <strong>item<\/strong> represents each array item<strong> (<\/strong>virat tamim ross<strong>)<\/strong> with each ongoing iteration. Finally, after printing the <strong>bash_array<\/strong> elements including the array length, the success of the conversion operation is visible. <\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-37444\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5-j-2-arr-forLoop.png\" alt=\"bash json to array with for loop\" width=\"825\" height=\"141\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5-j-2-arr-forLoop.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5-j-2-arr-forLoop-300x51.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5-j-2-arr-forLoop-768x131.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Read_JSON_Array_from_File_to_Convert_into_Bash_Array\"><\/span>How to Read JSON Array from File to Convert into Bash Array<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">To read a JSON array from a file and convert it into a Bash array, just use the &#8220;jq&#8221; command which will parse the JSON data from the specified file and assign the parsed elements to an array in Bash.<\/p>\n<p style=\"text-align: justify;\">Take the file data.json for example which contains a JSON array. To see the file content use the following command:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">nano data.json<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-37445\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6-array-in-file.png\" alt=\"json array in file\" width=\"825\" height=\"208\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6-array-in-file.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6-array-in-file-300x76.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6-array-in-file-768x194.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<p>Now, to convert the mentioned array in the file into a Bash array, see the example below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Read JSON array from file and parse it into a Bash array\nbash_array=($(jq -r &#039;.[]&#039; data.json))\n\n# Print Bash array elements\necho &quot;Bash array:&quot;\nfor element in &quot;${bash_array[@]}&quot;; do\n    echo &quot;$element&quot;\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>In the above code, the <code class=\"\" data-line=\"\">bash_array=($(jq -r &#039;.[]&#039; data.json))<\/code> command takes input from the file <strong>data.json<\/strong> (which is a JSON array) and extracts each element using the <strong>.[]<\/strong> flag and finally stores in the array-type variable <strong>bash_array<\/strong>. The &#8220;echo&#8221; command verifies this by displaying the array elements and the correct length.<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-37446\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7-file-to-array.png\" alt=\"json array from file converted into bash array\" width=\"825\" height=\"191\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7-file-to-array.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7-file-to-array-300x69.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7-file-to-array-768x178.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Solve_%E2%80%9Cjq_command_not_found%E2%80%9D_Error\"><\/span>How to Solve \u201cjq command not found\u201d Error<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In working with the JSON to Bash array conversion, one may encounter an issue where the<strong> jq<\/strong> command might not work as expected and the Bash script might throw an error like the following:<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-37447\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8-jq-not-found.png\" alt=\"jq command not found error\" width=\"825\" height=\"203\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8-jq-not-found.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8-jq-not-found-300x74.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8-jq-not-found-768x189.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>Here, the jq: command not found error occurs after executing the script due to its absence from the system.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Solution_Install_the_%E2%80%9Cjq%E2%80%9D_Command_Using_%E2%80%9Csudo_apt-get_install%E2%80%9D\"><\/span>Solution: Install the \u201cjq\u201d Command Using \u201csudo apt-get install\u201d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The solution is very simple. Just install the <strong>jq<\/strong> command using the following line of code in the terminal:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo apt-get install jq<\/code><\/pre>\n<p style=\"text-align: justify;\">However, first, update the system using the <code class=\"\" data-line=\"\">sudo apt update<\/code> to avoid unwanted behaviors:<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-37448\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9-sudo-update-b4-jq-install.png\" alt=\"system updation before installation jq\" width=\"825\" height=\"150\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9-sudo-update-b4-jq-install.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9-sudo-update-b4-jq-install-300x55.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9-sudo-update-b4-jq-install-768x140.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<p style=\"text-align: justify;\">Finally, you are good to go to install the &#8220;jq&#8221; command using <code class=\"\" data-line=\"\">sudo apt-get install jq<\/code> like the image below:<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-37449\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10-jq-installing.png\" alt=\"jq is being installed\" width=\"700\" height=\"103\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10-jq-installing.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10-jq-installing-300x44.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/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;\">JSON is a widely used data interchange format and is a necessary tool for modern software development and data processing tasks. This article discusses 5 useful methods of <strong>converting JSON array<\/strong> data structure to <strong>Bash array<\/strong> to facilitate working with Bash scripts that process JSON data. It mentions different commands like <strong>mapfile<\/strong>, <strong>readarray<\/strong>, and read to convert JSON arrays to arrays including iterative methods using <strong>for<\/strong> loop. It also discusses how to read an array from a file and convert it into a bash array along with mentioning potential challenges and their solutions while converting JSON arrays into Bash arrays.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"People_Also_Ask\"><\/span>People Also Ask<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"How_to_convert_a_JSON_array_into_a_Bash_array\"><\/span>How to convert a JSON array into a Bash array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To convert a <strong>JSON<\/strong> array into a Bash array, you can use the <strong>jq<\/strong> command line tool with process substitution with the syntax <code class=\"\" data-line=\"\">bash_array=($(echo &quot;$json_array&quot; | jq -r &#039;.[]&#039;))<\/code>. This parses the JSON array stored in the variable <strong>json_array<\/strong> and assigns each element to the <strong>bash_array<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_install_the_jq_command_in_my_Ubuntu_system\"><\/span>How to install the jq command in my Ubuntu system?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To install the &#8220;jq&#8221; command in your Ubuntu system, open the terminal, and run the command <code class=\"\" data-line=\"\">sudo apt update<\/code> first to update the system. Then run the command <code class=\"\" data-line=\"\">sudo apt-get install jq<\/code>. This will install the <strong>jq<\/strong> command on your system. After installation, you can again update the system by running the <code class=\"\" data-line=\"\">sudo apt update<\/code> command.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_access_specific_elements_of_JSON_array_in_Bash\"><\/span>Can I access specific elements of JSON array in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To access any specific element of a <strong>JSON<\/strong> array in Bash, you can use the &#8220;jq&#8221; command to extract the element you want to access using indexing by employing the syntax <strong>echo &#8220;$json_array&#8221; | jq -r &#8216;.[index]&#8217;<\/strong>. For example, to access the first element from <code class=\"\" data-line=\"\">json_array=&#039;[&quot;item1&quot;, &quot;item2&quot;, &quot;item3&quot;]&#039;<\/code>, use the syntax <code class=\"\" data-line=\"\">echo &quot;$json_array&quot; | jq -r &#039;.[0]&#039;<\/code>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_does_the_jq_command_do_in_converting_JSON_arrays_to_Bash_arrays\"><\/span>What does the jq command do in converting JSON arrays to Bash arrays?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The<strong> jq<\/strong> command extracts each element of the JSON array in converting such an array into Bash arrays by using the <strong>.[]<\/strong> notation within the full syntax <code class=\"\" data-line=\"\">echo &quot;$json_array&quot; | jq -r &#039;.[]&#039;<\/code> and outputs the elements as separate lines. The<code class=\"\" data-line=\"\"> -r<\/code> option outputs strings without quotes to make them suitable for Bash array assignment.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_is_the_jq_command_in_Linux\"><\/span>What is the jq command in Linux?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The Linux &#8220;jq&#8221; command is a flexible and lightweight tool to process and manipulate JSON data directly using the command line or within the Bash scripts. With the &#8220;jq&#8221; command, it is possible to parse data easily, filter based on specific fields, and transform JSON objects and arrays efficiently to work.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_is_a_JSON_array\"><\/span>What is a JSON array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">A <strong>JSON array<\/strong> is a data structure in JSON <strong>(<\/strong>JavaScript Object Notation<strong>)<\/strong> presenting an ordered collection of values. In a JSON array, the elements are enclosed within square brackets separated by commas. The elements can be of any various types such as strings, numbers, boolean, or even arrays.<\/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 to convert a JSON array into a Bash array?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To convert a JSON array into a Bash array, you can use the jq command line tool with process substitution with the syntax bash_array=($(echo \\\"$json_array\\\" | jq -r '.[]')). This parses the JSON array stored in the variable json_array and assigns each element to the bash_array.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How to install the jq command in my Ubuntu system?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To install the \\\"jq\\\" command in your Ubuntu system, open the terminal, and run the command sudo apt update first to update the system. Then run the command sudo apt-get install jq. This will install the jq command on your system. After installation, you can again update the system by running the sudo apt update command.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"Can I access specific elements of JSON array in Bash?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To access any specific element of a JSON array in Bash, you can use the \\\"jq\\\" command to extract the element you want to access using indexing by employing the syntax echo \\\"$json_array\\\" | jq -r '.[index]'. For example, to access the first element from json_array='[\\\"item1\\\", \\\"item2\\\", \\\"item3\\\"]', use the syntax echo \\\"$json_array\\\" | jq -r '.[0]'.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What does the jq command do in converting JSON arrays to Bash arrays?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"The jq command extracts each element of the JSON array in converting such an array into Bash arrays by using the .[] notation within the full syntax echo \\\"$json_array\\\" | jq -r '.[]' and outputs the elements as separate lines. The -r option outputs strings without quotes to make them suitable for Bash array assignment.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What is the jq command in Linux?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"The Linux \\\"jq\\\" command is a flexible and lightweight tool to process and manipulate JSON data directly using the command line or within the Bash scripts. With the \\\"jq\\\" command, it is possible to parse data easily, filter based on specific fields, and transform JSON objects and arrays efficiently to work.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What is a JSON array?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"A JSON array is a data structure in JSON (JavaScript Object Notation) presenting an ordered collection of values. In a JSON array, the elements are enclosed within square brackets separated by commas. The elements can be of any various types such as strings, numbers, boolean, or even arrays.\"\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\/array-operations\/array-of-strings-with-spaces\/\" target=\"_blank\" rel=\"noopener\">Master Bash Array of Strings with Spaces [Complete Guide]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/convert-string-to-array\/\" target=\"_blank\" rel=\"noopener\">How to Convert String into Array in Bash [8 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/array-append\/\" target=\"_blank\" rel=\"noopener\">How to Append to an Array in Bash? [4 Easy Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/clear-array\/\" target=\"_blank\" rel=\"noopener\">How to Clear an Array in Bash [6 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/filter-array\/\" target=\"_blank\" rel=\"noopener\">How to Filter an Array in Bash? [8 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/copy-array\/\" target=\"_blank\" rel=\"noopener\">How to Copy an Array in Bash [6 Simple Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/reverse-array\/\" target=\"_blank\" rel=\"noopener\">How to Reverse an Array in Bash? [8 Easy Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/array-slice\/\" target=\"_blank\" rel=\"noopener\">How to Slice an Array in Bash [10 Simple Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/foreach-array\/\" target=\"_blank\" rel=\"noopener\">Iterate Through a Bash Array Using \u201cforeach\u201d Loop [5 Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/empty-array\/\" target=\"_blank\" rel=\"noopener\">How to Check If an Array is Empty in Bash? [5 Methods]<\/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;Array Operations in Bash&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\/array-operations\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/\" target=\"_blank\" rel=\"noopener\">Array Operations in Bash<\/a><\/span> | <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;37437&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;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&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;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;How to Convert a JSON Array into Bash Array [5 Methods]&quot;,&quot;width&quot;:&quot;0&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: 0px;\">\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            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>You can use the following methods to convert a JSON array into a Bash array: Using jq with command substitution: &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Convert a JSON Array into Bash Array [5 Methods]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#more-37437\" aria-label=\"Read more about How to Convert a JSON Array into Bash Array [5 Methods]\">Read more<\/a><\/p>\n","protected":false},"author":314910,"featured_media":37450,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[180],"class_list":["post-37437","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-array-operations","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>How to Convert a JSON Array into Bash Array [5 Methods] - LinuxSimply<\/title>\n<meta name=\"description\" content=\"In this article, you will learn how to convert a JSON array into an array in Bash to process data in Bash.\" \/>\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\/array-operations\/json-to-array\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Convert a JSON Array into Bash Array [5 Methods] - LinuxSimply\" \/>\n<meta property=\"og:description\" content=\"In this article, you will learn how to convert a JSON array into an array in Bash to process data in Bash.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-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=\"2024-02-22T05:59:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-17T03:18:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/11-Feature-Bash-json-to-array.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=\"9 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\\\/array-operations\\\/json-to-array\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/\"},\"author\":{\"name\":\"Md Masrur Ul Alam\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/64033dc86d4cd3b6a549cd0ae9e73423\"},\"headline\":\"How to Convert a JSON Array into Bash Array [5 Methods]\",\"datePublished\":\"2024-02-22T05:59:51+00:00\",\"dateModified\":\"2024-03-17T03:18:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/\"},\"wordCount\":1590,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/11-Feature-Bash-json-to-array.png\",\"keywords\":[\"array operations\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/\",\"name\":\"How to Convert a JSON Array into Bash Array [5 Methods] - LinuxSimply\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/11-Feature-Bash-json-to-array.png\",\"datePublished\":\"2024-02-22T05:59:51+00:00\",\"dateModified\":\"2024-03-17T03:18:09+00:00\",\"description\":\"In this article, you will learn how to convert a JSON array into an array in Bash to process data in Bash.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-array\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/11-Feature-Bash-json-to-array.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/11-Feature-Bash-json-to-array.png\",\"width\":400,\"height\":400,\"caption\":\"bash json to array feature image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/json-to-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\":\"Array Operations in Bash\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/array\\\/array-operations\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"How to Convert a JSON Array into Bash Array [5 Methods]\"}]},{\"@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":"How to Convert a JSON Array into Bash Array [5 Methods] - LinuxSimply","description":"In this article, you will learn how to convert a JSON array into an array in Bash to process data in Bash.","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\/array-operations\/json-to-array\/","og_locale":"en_US","og_type":"article","og_title":"How to Convert a JSON Array into Bash Array [5 Methods] - LinuxSimply","og_description":"In this article, you will learn how to convert a JSON array into an array in Bash to process data in Bash.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/prem.masrur\/","article_published_time":"2024-02-22T05:59:51+00:00","article_modified_time":"2024-03-17T03:18:09+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/11-Feature-Bash-json-to-array.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":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/"},"author":{"name":"Md Masrur Ul Alam","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/64033dc86d4cd3b6a549cd0ae9e73423"},"headline":"How to Convert a JSON Array into Bash Array [5 Methods]","datePublished":"2024-02-22T05:59:51+00:00","dateModified":"2024-03-17T03:18:09+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/"},"wordCount":1590,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/11-Feature-Bash-json-to-array.png","keywords":["array operations"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/","name":"How to Convert a JSON Array into Bash Array [5 Methods] - LinuxSimply","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/11-Feature-Bash-json-to-array.png","datePublished":"2024-02-22T05:59:51+00:00","dateModified":"2024-03-17T03:18:09+00:00","description":"In this article, you will learn how to convert a JSON array into an array in Bash to process data in Bash.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-array\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/11-Feature-Bash-json-to-array.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/11-Feature-Bash-json-to-array.png","width":400,"height":400,"caption":"bash json to array feature image"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/json-to-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":"Array Operations in Bash","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/array\/array-operations\/"},{"@type":"ListItem","position":5,"name":"How to Convert a JSON Array into Bash Array [5 Methods]"}]},{"@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\/37437","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=37437"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/37437\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/37450"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=37437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=37437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=37437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}