"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: POSIX function syntax for regress/cmdline/*.sh
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Sun, 13 Sep 2020 08:22:58 +0200

Download raw body.

Thread
On Sat, Sep 12, 2020 at 11:18:28PM +0200, Christian Weisgerber wrote:
> The shell scripts under regress/cmdline/ don't look very demanding,
> but there is the teeny issue that
> 
>   function foo ...
> 
> is not sh syntax.  It's Korn shell.  The Bourne/POSIX shell way to
> define a function is
> 
>   foo() ...
> 
> I would like to fix this.
> 
> -function test_add_basic {
> +test_add_basic() {
> 
> I'm not including a diff; it's a mechanical change for about three
> hundred function definitions.  I ran sed over *.sh and the tests
> are still fine.
> 
> ok?

There was some small semantic difference about variable scopes,
wasn't there? Anyway, you've already confirmed that tests are
still passing so, yes, let's use the POSIX way.