Can a list of objects be made and operated on in a BASH environment Can a list of objects be made and operated on in a BASH environment unix unix

Can a list of objects be made and operated on in a BASH environment


Here is the example of what you want:

samples=(sample1 sample2 sample3)currentSample=${samples[0]}echo "$currentSample"echo "${samples[0]}"

Output:

sample1 sample1

As you can see you can assign array's value to a variable or use its value directly.