Re:Something about functions in Bash (2017)
by KeyboardFire on Thursday July 05, 2018 @03:39PM
(#17466171)
Hmm, why doesn't `fn() echo test; fn` work? It seems to work in zsh, but not bash.
[ Parent
| on HN ]
Re:Something about functions in Bash (2017)
by HerrMonnezza on Thursday July 05, 2018 @04:18PM
(#17466458)
Because `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-...