From: David Laight <David.Laight@ACULAB.COM>
To: 'Steffen Kothe' <steffen.kothe@skothe.de>,
Saravana Kannan <saravanak@google.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] scripts: dev-needs.sh: Enforce bash usage
Date: Mon, 14 Nov 2022 10:30:29 +0000 [thread overview]
Message-ID: <cff9a58b31e3493fb1231db54705bb30@AcuMS.aculab.com> (raw)
In-Reply-To: <Y29qN1fFq4SFXCT2@p50>
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!
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2022-11-14 10:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 17:03 [PATCH] scripts: dev-needs.sh: Enforce bash usage Steffen Kothe
2022-11-09 22:58 ` Saravana Kannan
2022-11-10 17:48 ` Steffen Kothe
2022-11-10 19:32 ` Saravana Kannan
2022-11-12 9:41 ` Steffen Kothe
2022-11-14 10:30 ` David Laight [this message]
2023-01-25 2:25 ` Saravana Kannan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cff9a58b31e3493fb1231db54705bb30@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=linux-kernel@vger.kernel.org \
--cc=saravanak@google.com \
--cc=steffen.kothe@skothe.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox