Can't you use a single echo with `${2:-$1}` instead of the whole if-then-else?