It complains that "function" command not found. Function was introduced by ksh but not all shells use it, see https://unix.stackexchange.com/a/73854/103652 for reference.
I changed function banner { to banner () { and it was much happier. This is also POSIX compliant so should work on /bin/sh and maybe even /bin/dash or /bin/zsh.