bash: Why am I getting syntax error near unexpected token `}'?

I have a very simple script which is running inside a docker container and using vs-code with utf-8 character encoding in settings without automatically changing encoding based on file.


echo "hello!";

HELLO () {
  # function budy

This keeps generating the following error:

./ line 7: syntax error near unexpected token `}'
./ line 7: `}'

I have tried adding and removing spaces but to no avail. I have also tried to explicitly save file with encoding utf-8 using the editor but also to no avail.

I don't know what is causing the issue and I feel lost.


  • Your function body cannot be empty:

    HELLO() {
      echo "hello!"

    This will work