Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14789

Re: exiting noninteractive shells on 'shift 2'

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: exiting noninteractive shells on 'shift 2'
Date 2018-11-09 11:55 -0500
Message-ID <mailman.3756.1541782550.1284.bug-bash@gnu.org> (permalink)
References (2 earlier) <9ced783a-1c2b-f2c8-2287-fc0f6b967fa8@redhat.com> <fbe5c62d-d633-2fa5-32d1-591ff41a23cc@case.edu> <685c4d41-dcf1-61bc-0b65-04e2b180d568@redhat.com> <26ebd997-741d-0966-de68-4c0b4ea00c15@case.edu> <63172bfd-1016-fe59-f2e4-2c67a6c779cc@redhat.com>

Show all headers | View raw


On 11/9/18 11:46 AM, Eric Blake wrote:
> On 11/9/18 10:42 AM, Chet Ramey wrote:
> 
>>
>>>      A diagnostic message shall be written to standard error whenever an
>>> error condition occurs."
>>>
>>> Since 'shift 2' when $# is 1 is an error, and results in non-zero status,
>>> it should print a diagnostic to stderr.
>>
>> So maybe the thing to do is to turn on the shift_verbose option in posix
>> mode.
> 
> Cool - I didn't realize we already had a shopt for that. Yes, it sounds
> like in POSIX mode, shift_verbose should be turned on.
> 
> On a related note, should turning on POSIX mode also auto-enable xpg_echo?

No. That's just more of a can of worms than I want to deal with. Bash
claims strict conformance with both posix and xpg_echo enabled (that's what
the `strict-posix' configure option does, among other things).

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: exiting noninteractive shells on 'shift 2' Chet Ramey <chet.ramey@case.edu> - 2018-11-09 11:55 -0500

csiph-web