consider I have an array array1 (a b c d e).
Now based on some calculations I would get a No. which is the index of the above array.Say for example I get 3.Then, I would remove the third value from the array and rearrange the array as
array1 (d e a b).
To get a slice of a bash array you can do stuff like
a=(a b c d e)
b=${a[@]:0:2} # gets a b
So your particular problem could be done with
b=( ${a[@]:3:2} ${a[@]:0:2} )
echo ${b[@]}
If necessary, you could generalise to use a variable instead of the literal '3' and then complute how many elements you need from each slice; you can get the length of the array with ${#a[@]}.