Pierre Gaston <pierre.gas...@gmail.com> writes: > On Mon, Feb 26, 2018 at 12:45 PM, <moos...@gmail.com> wrote: > [..snip..]
>> >> $ func() true >> bash: syntax error near unexpected token `true' >> >> # Variant#2 >> $ func() { true } >> > ^C >> >> Both forms seem to be valid per [1] and are accepted by (at least) >> ash, zsh and mksh >> >> Worth noting that the Variant#2 can be made to work in bash with an >> addition >> of a semicolon: >> >> $ func() { true; } >> >> [1] http://pubs.opengroup.org/onlinepubs/9699919799/ >> utilities/V3_chap02.html >> >> -- >> mailto:moos...@gmail.com >> >> > On the contrary SUS doesn't define either one, as function definition > requires a compound command > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_05 > > and it requires a delimiter in compound commands > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04 Thanks. -- mailto:moos...@gmail.com