for((i=\${#myArray[@]}-1;i>=0;i--)); do
        reversed+=("\${myArray[i]}")
      done
      
      unset "myArray" # optional
      echo "\${reversed[@]}"
      

      Shell language logo
      array reverse

      Shell public recipes

      Shortcut: array.reverse

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.