Discussion:
[Help-bash] Targeting minimal POSIX compliance
Joel Ebel
2018-04-04 20:31:19 UTC
Permalink
I'm attempting to build bash for a minimal environment where I would like
bash to be small, fast, and with minimal dependencies, but I would like to
still target POSIX compliance. I had first assumed that
--enable-minimal-config would still provide POSIX compliance, but I noticed
several features being disabled that I believe are required for POSIX
compliance. Notably, job control and alias. Are there other features that
need to be re-enabled with --enable-minimal-config in order to achieve
POSIX compliance?

Joel
Chet Ramey
2018-04-04 20:58:17 UTC
Permalink
Post by Joel Ebel
I'm attempting to build bash for a minimal environment where I would like
bash to be small, fast, and with minimal dependencies, but I would like to
still target POSIX compliance. I had first assumed that
--enable-minimal-config would still provide POSIX compliance, but I noticed
several features being disabled that I believe are required for POSIX
compliance. Notably, job control and alias. Are there other features that
need to be re-enabled with --enable-minimal-config in order to achieve
POSIX compliance?
--enable-job-control
--enable-alias
--enable-readline
--enable-history
--enable-strict-posix-default

Technically, you need history to make `fc' work. Readline is needed for sh
vi-mode line editing (if the implementation wants to support the Posix
"User Portability Utilities" option).
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU ***@case.edu http://tiswww.cwru.edu/~chet/
Joel Ebel
2018-04-05 14:58:13 UTC
Permalink
Post by Joel Ebel
Post by Joel Ebel
I'm attempting to build bash for a minimal environment where I would like
bash to be small, fast, and with minimal dependencies, but I would like
to
Post by Joel Ebel
still target POSIX compliance. I had first assumed that
--enable-minimal-config would still provide POSIX compliance, but I
noticed
Post by Joel Ebel
several features being disabled that I believe are required for POSIX
compliance. Notably, job control and alias. Are there other features that
need to be re-enabled with --enable-minimal-config in order to achieve
POSIX compliance?
--enable-job-control
--enable-alias
--enable-readline
--enable-history
--enable-strict-posix-default
Technically, you need history to make `fc' work. Readline is needed for sh
vi-mode line editing (if the implementation wants to support the Posix
"User Portability Utilities" option).
Thanks for the quick reply. On more consideration, this is not targeting
interactive use, only scripts to start programs, or callouts with system()
and popen(). Users have the option to install complete bash at /bin/bash if
they want additional features or interactive use. In that case, I don't
think any of these options are necessary, except perhaps
--enable-strict-posix-default. Does that make any difference if the binary
is installed at /bin/sh? Are any of these options likely to affect
non-interactive use?
Chet Ramey
2018-04-05 15:32:20 UTC
Permalink
Post by Chet Ramey
Post by Joel Ebel
I'm attempting to build bash for a minimal environment where I would like
bash to be small, fast, and with minimal dependencies, but I would like to
still target POSIX compliance. I had first assumed that
--enable-minimal-config would still provide POSIX compliance, but I noticed
several features being disabled that I believe are required for POSIX
compliance. Notably, job control and alias. Are there other features that
need to be re-enabled with --enable-minimal-config in order to achieve
POSIX compliance?
--enable-job-control
--enable-alias
--enable-readline
--enable-history
--enable-strict-posix-default
Technically, you need history to make `fc' work. Readline is needed for sh
vi-mode line editing (if the implementation wants to support the Posix
"User Portability Utilities" option).
Thanks for the quick reply.  On more consideration, this is not targeting
interactive use, only scripts to start programs, or callouts with system()
and popen(). Users have the option to install complete bash at /bin/bash if
they want additional features or interactive use. In that case, I don't
think any of these options are necessary, except perhaps
--enable-strict-posix-default. Does that make any difference if the binary
is installed at /bin/sh? Are any of these options likely to affect
non-interactive use?
--enable-strict-posix-default makes the options that posix mode enables
(which happen when the shell is named `sh') the default, and enables the
xpg_echo option (which, as you can imagine, is controversial). You do
probably want aliases.

Bash doesn't really have a minimal, nothing-beyond-posix mode. It's never
been a requirement. If you want that, dash is available.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU ***@case.edu http://tiswww.cwru.edu/~chet/
Loading...