Showing posts with label Array example in bash shell script. Show all posts
Showing posts with label Array example in bash shell script. Show all posts

Sunday, November 27, 2022

Array example in bash shell script

 #!/bin/bash

# Create an indexed array

IndexedArray=(egg burger milk)

#Iterate over the array to get all the values

for i in "${IndexedArray[@]}";do echo "$i";done


Source:https://www.hostinger.in/tutorials/bash-script-example