Hands-on task
This task is step 11 of the course “Bash: expansions, arrays and quoting”
Arrays in bash
Write a script /root/arr.sh that creates an array of three elements apple banana cherry and prints the number of elements and the second element separated by a space.
Reference:Variables and expansions
What you'll practise:
- bash arrays
- ${arr[@]}
- indexing
- bash scripts