
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Assignment; Professor: Kaul; Class: Introduction to Visual Effects Programming; Subject: Visual Effects; University: Savannah College of Art and Design; Term: Unknown 1989;
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!
Arrays are a list of strings or numbers and are popular in every programming language, not just bash. You will need to see their awesome power to fully appreciate what they can do for you.
Type this in:
names=(Paco Juan Dave Francois Helmut) echo “The number of elements in the array names is ${#names[@]}” echo “The first element in the array names has an index of 0 and is ${names[0]}” echo “The length of ${names[0]} is ${#names[0]}”
for i in ${names[@]}; do echo “I like the name $i.” done
echo ${names[0]:0] # This returns paco echo ${names[0]:0:2] # This returns pa echo ${names[0]:2] # This returns co
Your assignment: Take this script and see if you can make some innovative use of arrays in bash scripting. There is an incredible amount of uses for them.