Team, I have a use case to save remainder of array into new array while looping on its indices and new array should have all elements except the looped element.
$ a=(1 2 3 4 5)
$ b=()
for index in ${!a[@]}
do
b=(a - a[$index]) #how would i code his that it works ?
echo ${b[@]}
done
expected loop values for each iteration.
1 2 3 4
1 2 3 5
1 2 4 5
1 3 4 5
2 3 4 5