17.11.2024 22:49, George Koehler пишет:
> On Sun, 17 Nov 2024 19:10:30 +0000
> Klemens Nanni <k...@openbsd.org> wrote:
> 
>> 17.11.2024 20:25, Andreas Kähäri пишет:
>>> A the final right curly brace of a compound command must be preceeded by
>>> a command terminator
>>
>> Not always:
>>
>>      $ f() {} ; typeset -f f
>>      f() {}
> 
> That isn't a compound command,
> 
>       $ f() {}; f
>       ksh: {}: not found
> 
> It's a single command, like
> 
>       $ f() uname; f
>       OpenBSD
> 
> To make a compound command, the { and } must be the first word of
> a command; {} is a different word.

Ah, spaces between { and } are significant.

So is this a compound command?  Looks like one:

        $ f() { }; typeset -f f
        f() {
            
        }

Reply via email to