[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Targeting minimal POSIX compliance
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] Targeting minimal POSIX compliance |
Date: |
Thu, 5 Apr 2018 11:32:20 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 4/5/18 10:58 AM, Joel Ebel wrote:
> On Wed, Apr 4, 2018 at 4:58 PM, Chet Ramey <address@hidden
> <mailto:address@hidden>> wrote:
>
> On 4/4/18 4:31 PM, Joel Ebel wrote:
> > 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 address@hidden http://tiswww.cwru.edu/~chet/