I would like to make a loop and get the previous and next elements inside the loop. Currently, I used the following bouquet:
for file in $dir;do [...do some things...] done
Is it possible to do something like C, for example, the file [i-1] / file [i + 1] to get the previous and next elements? Is there an easy way to do this.
source share