20/04/17 20:57:55 xgpGiYXu.net
foo() if true; then echo "foobar"; fi
↑こういうのはOK
↓shellcheckの解説
POSIX allows the body of a function to be any compound command, e.g. foo() for i; do :; done. Since this usage is rare, ShellCheck intentionally requires the body to be { ..; } (or ( ..; )):
URLリンク(github.com)