1 # Towers of Hanoi in bash
3 # cribbed from the ksh93 book, example from exercises on page 85
8 hanoi
() # n from to spare
11 ((nm1
>0)) && hanoi
$nm1 $2 $4 $3
12 echo "Move disc $2 to $3"
13 ((nm1
>0)) && hanoi
$nm1 $4 $3 $2
19 *) echo "${0##*/}: Argument must be from 1 to 9"