4 ms·
Hmm, why doesn't `fn() echo test; fn` work? It seems to work in zsh, but not bash.
by KeyboardFire 8y ago
Hmm, why doesn't `fn() echo test; fn` work? It seems to work in zsh, but not bash.
- HerrMonnezza 8y agoBecause `echo test` is not a compound command. Informally, a compound command is a list of commands (`( ... )` or `{ ... }`) or a looping or conditional construct. See [1] for a precise definition. [1]: https://tiswww.case.edu/php/chet/bash/bashref.html#Compound-Commands https://tiswww.case.edu/php/chet/bash/bashref.html#Compound-...