0

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)

In a new bash shell, I tried to declare a function but saw the following error:

syntax error near unexpected token `str'

I'm curious why the closing character ' is not the same as the opening character ` here. If I were crafting this error, the most logical way I could think of would be:

syntax error near unexpected token 'str'

i.e. both an opening and closing ' character. I assume there's a technical or historical reason for this, but I don't know what that could be.

Richie Thomas
  • 415
  • 3
  • 9

0 Answers0