#!/bin/sh set -o nounset -o errexit -o xtrace case ${1-undef} in undef) $0 7 1 0;; 0) echo $3;; 1) echo $2;; *) $0 $(($1 - 1)) $(($2 + $3)) $2 esac