Add 'bash/array_append.bash'
This commit is contained in:
13
bash/array_append.bash
Normal file
13
bash/array_append.bash
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Declare a string array
|
||||||
|
arrVar=("AC" "TV" "Mobile" "Fridge" "Oven" "Blender")
|
||||||
|
|
||||||
|
# Add new element at the end of the array
|
||||||
|
arrVar+=("Dish Washer")
|
||||||
|
|
||||||
|
# Iterate the loop to read and print each array element
|
||||||
|
for value in "${arrVar[@]}"
|
||||||
|
do
|
||||||
|
echo $value
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user