0

I cant figure out what's wrong with this:

$ {echo 3; echo 4; echo 5;} | cat

I get this:

bash: syntax error near unexpected token `}'

I am on bash version 3.2. On zsh version 5.8, seems to work fine. Why doesn't old bash like this?

Alexander Mills
  • 9,330
  • 19
  • 95
  • 180

1 Answers1

0

Looks like syntactically, we need a space here:

  { echo 3; echo 4; echo 5;} | cat

~~ ^ ~~~
Alexander Mills
  • 9,330
  • 19
  • 95
  • 180