I accidentally input the the following command into the Bash terminal:
And the Bash keeps read the next line until I input a string literal and Bash gives the error of "-bash: syntax error near unexpected token".
So I test some other similar inputs like:
The Bash gives the similar output. The following is the result I got:
~ $ foo () > bar -bash: syntax error near unexpected token `bar'
Can someone explain why. I only know the parentheses are used to create arrays or subshell. I don't know what this one actually does.