-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 9/5/12 10:40 PM, Dan Douglas wrote:
> This reorder function is meant to swap values of a two-element array if
> unordered. Bash and ksh produce reversed results. mksh and zsh do as expected.
[...]
> The Ksh issue seems to be that an explicit
This reorder function is meant to swap values of a two-element array if
unordered. Bash and ksh produce reversed results. mksh and zsh do as expected.
#!/usr/bin/env bash
[[ -n ${ZSH_VERSION+_} ]] && emulate ksh
function reorder {
(( x[1] < x && (x=x[1], x[1]=$x) ))
e