{"id":2773,"date":"2019-11-15T05:47:48","date_gmt":"2019-11-15T05:47:48","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=2773"},"modified":"2019-11-15T06:05:58","modified_gmt":"2019-11-15T06:05:58","slug":"bash-array-example","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/bash-array-example\/","title":{"rendered":"Bash array example"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#!\/bin\/bash\narray=(one two three)\necho \"Printing first object in array.\"  #Replace 0 with the place number of the array item\necho ${array[0]}\n\necho \"\"\n\necho \"Whole array\"\necho ${array[*]} \n\necho \"\" \n\necho \"Array indexes\" \necho ${!array[*]}<\/pre>\n\n\n\n<p>Output<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Printing first object in array. \none\n\nWhole array\none two three\n\nArray indexes\n0 1 2<\/pre>\n\n\n\n<p><a href=\"https:\/\/www.linuxjournal.com\/content\/bash-arrays\">https:\/\/www.linuxjournal.com\/content\/bash-arrays<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/bash array=(one two three) echo &#8220;Printing first object in array.&#8221; #Replace 0 with the place number of the array item echo ${array[0]} echo &#8220;&#8221; echo &#8220;Whole array&#8221; echo ${array[*]} echo &#8220;&#8221; echo &#8220;Array indexes&#8221; echo ${!array[*]} Output Printing first object &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/bash-array-example\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[740,211,644,7,606,405],"class_list":["post-2773","post","type-post","status-publish","format-standard","hentry","category-command-line","category-linux","tag-array","tag-bash","tag-code","tag-linux-2","tag-programming","tag-scripting"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=2773"}],"version-history":[{"count":2,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2773\/revisions"}],"predecessor-version":[{"id":2790,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2773\/revisions\/2790"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=2773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=2773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=2773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}