You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Joachim Ansorg edited this page Nov 12, 2021
·
5 revisions
Expected a }. If you have one, try a ; or \n in front of it.
Problematic code:
#!/bin/bashbar() { echo"hello world" }
Correct code:
#!/bin/bashbar() { echo"hello world";}
Rationale:
} is only recognized as the end of a command group when it's a separate token.
If it's not a separate token, like in the problematic example, it will be considered a literal character, as if writing echo "foo}" with quotes, and therefore usually cause a syntax error.