13.Write a shell script to elements of array

 #!/bin/bash

# Correct array initialization

arr=("apple" "banana" "cherry" "date")

# Print array elements

echo "Array elements:"

for element in "${arr[@]}"; do

    echo "$element"

done


Comments

Popular posts from this blog

3.Write a shell script to print below pattern 1 1 2 1 1 3 3 1