[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGETcx9io_3DYqpyo4yPZjicp+P83oZ5zuRP9FRNxXB1+XcGrQ@mail.gmail.com>
Date: Tue, 24 Jan 2023 18:25:35 -0800
From: Saravana Kannan <saravanak@...gle.com>
To: David Laight <David.Laight@...lab.com>
Cc: Steffen Kothe <steffen.kothe@...the.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scripts: dev-needs.sh: Enforce bash usage
On Mon, Nov 14, 2022 at 2:30 AM David Laight <David.Laight@...lab.com> wrote:
>
> From: Steffen Kothe
> > Sent: 12 November 2022 09:41
> ...
> > What about a re-write of the script in POSIX compliant style? This
> > should work then in every shell derivate without weird checks.
> >
> > This would remove for example function declarations, arrays and so on,
> > targeting to the same printable output but with different logic in the
> > background.
>
> A quick read:
>
> - remove the word 'function'.
> - remove all 'local', ensure names are unique.
> - use 'printf '%s' "....." instead of echo -n.
>
> That should be pretty near portable.
> Some shells that don't object to the 'local' keyword don't
> actually implement local variables!
>
Steffen/David,
I'll happily test and take any updates that's at least as readable as
what's there now, as long as it continues working with toybox.
-Saravana
Powered by blists - more mailing lists