bug-bash
[Top][All Lists]
Advanced

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

Re: shopt help possibly wrong


From: hugogabriel . eyherabide
Subject: Re: shopt help possibly wrong
Date: Fri, 27 Jul 2018 09:59:08 -0700 (PDT)
User-agent: G2/1.0

El viernes, 27 de julio de 2018, 17:20:41 (UTC+3), Chet Ramey escribió:
> On 7/27/18 7:00 AM, Hugo Gabriel Eyherabide wrote:
> 
> > Bash Version: 4.3
> > Patch Level: 48
> > Release Status: release
> > 
> > Description:
> >         After reading the documentation in "help shopt" I attempted to set
> > flags, for example, noclobber, by using "shopt -s noclobber", but got an
> > error message. I've found that I can do that by using "shopt -s -o
> > -noclobber" but that the help provided me no indication that the additional
> > "-o" was actually necessary.
> > 
> > Repeat-By:
> >         Using "shopt -s noclobber" (or any optname) instead of "shopt -s -o
> > noclobber).
> 
> There is a set of option names for use by `set -o' (mostly the ones
> corresponding to `set' options and those defined by POSIX) and a bash-
> specific set available for use with `shopt'. Read the documentation to
> tell the difference.
> 

The problem is that the documentation and the help are not entirely consistent. 
In particular, the help for -o stated that it 'restricts', as opposed to 
'requires',  OPTNAMEs to those defined for use with `set -o'. It is not a 
matter of not understanding the difference between the optnames, but a matter 
of the help, as opposed to the documentation being ambiguous and inconsistent. 
Which one should be trusted then: the help or the documentation? Of course, the 
source code.


> > 
> > Fix:
> >         I would suggest to change the help of shopt so that it says [-o
> > [optname ...] ] instead of [-o] [optname ...], and change the help where
> > relevant.
> 
> That would be wrong.
> 

Indeed, but should have given a clue on how to solve the problem. Perhaps using 
[optnameposix | -o optnameset] or something else.

> -- 
> ``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/



reply via email to

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