Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
9
Task/Collections/UNIX-Shell/collections-1.sh
Normal file
9
Task/Collections/UNIX-Shell/collections-1.sh
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
a_index=(one two three) # create an array with a few elements
|
||||
a_index+=(four five) # append some elements
|
||||
a_index[9]=ten # add a specific index
|
||||
for elem in "${a_index[@]}"; do # interate over the elements
|
||||
echo "$elem"
|
||||
done
|
||||
for idx in "${!a_index[@]}"; do # interate over the array indices
|
||||
printf "%d\t%s\n" $idx "${a_index[idx]}"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue