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

10.Write a shell script to count the number words,lines,character from given file accept file name from commandline.

2.Write a shell script to compile all C files and delete those files having errors.