Scott M. Mcdermott

UNIX Systems & Network Administrator
available for contract or salaried positions

array_reverse

#
# Returns a sequence reversed from the original input
#

source ~/lib/sh/include
require freturn

array_reverse ()
{
        local -i i
        local -a a

        for ((i = $#; i > 0; i--)); do
                a+=(${!i})
        done

        freturn ${a[@]}
}
# vim:syn=sh:ft=sh