help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Clarify the meaning of 's' in $- and the meaning of -s w


From: Cristian Zoicas
Subject: Re: [Help-bash] Clarify the meaning of 's' in $- and the meaning of -s when invoking bash
Date: Thu, 16 Mar 2017 16:08:30 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40

Stephane Chazelas wrote:
2017-03-16 08:27:53 +0100, address@hidden:
[...]
It seems to me that the 's' flag is supposed to be shown in $- when
bash reads  the standard input. Such  a case occur when  bash is invoked
with the -s option. Example:

     $ echo 'echo $-' | bash -s
     hBs

However,  bash reads  the standard  input also  when there  are no  more
arguments  after option  processing.  Example

    $ echo 'echo $-' | bash
    hB
[...]

That was a non-conformance (or at least deviation from every
other Bourne-like shell) of bash. It was fixed in 4.4

$ echo 'echo $- $BASH_VERSION' | bash
hBs 4.4.11(1)-release

IIRC, that was discussed last year either on the Austin group or
bug-bash mailing list.


Stephane, thank you for your prompt reply.
Cristian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]