I'm trying to reverse a 1-D array which contains a list of files. I followed https://stackoverflow.com/questions/13360091/how-to-reverse-array-in-bash-onliner-for-loop to be the code. But this is not quite working for me.
for (( i=${#FILES_dcn[@]}-1,j=0 ;i>=0;i--,j++ ));
do
dcnarray[j] = ${FILES_dcn[i]}
done
The values are not getting copied when I echo the arrays onto a file. Why is that??