I have an array which i want to create a new array based on that, which contains just my particular selected items by index number.
for example i want to have an array which contains just two and five or with index number [2,4]
do you have an idea how to do it with bash script. i am new in bash thanks
array1=( one two three four five )
echo ${array1[@]}
result
array2 = (two five)