Re: -i option of set missing in man bash

2015-03-12 Thread Chet Ramey
On 3/11/15 6:59 PM, Peng Yu wrote:
> Hi,
> 
> The -i option obviously works with set. But it is missing in the man
> page. Should this be added?

No.  It's really only there for completeness, so things like `set $-'
work as expected without error.  The -s option does the same thing,
for example.

-i is described in the OPTIONS section of the man page, since invocation
is the only place using it makes sense.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/



Re: -i option of set missing in man bash

2015-03-12 Thread Peng Yu
>> The -i option obviously works with set. But it is missing in the man
>> page. Should this be added?
>
> No.  It's really only there for completeness, so things like `set $-'
> work as expected without error.

But if something is in the implementation, it should be also in the
documentation, right?

>  The -s option does the same thing,
> for example.
>
> -i is described in the OPTIONS section of the man page, since invocation
> is the only place using it makes sense.

Not necessarily. See my other example sent recently on the mailing
list of trying to get COLUMNS.

One may want to manually set -i option in a bash script for whatever
reason. (In this case, it is to check COLUMNS.)

-- 
Regards,
Peng



Re: -i option of set missing in man bash

2015-03-12 Thread Greg Wooledge
On Thu, Mar 12, 2015 at 01:13:18PM -0500, Peng Yu wrote:
> One may want to manually set -i option in a bash script for whatever
> reason. (In this case, it is to check COLUMNS.)

http://mywiki.wooledge.org/BashFAQ/091



Re: -i option of set missing in man bash

2015-03-12 Thread Peng Yu
On Thu, Mar 12, 2015 at 1:29 PM, Greg Wooledge  wrote:
> On Thu, Mar 12, 2015 at 01:13:18PM -0500, Peng Yu wrote:
>> One may want to manually set -i option in a bash script for whatever
>> reason. (In this case, it is to check COLUMNS.)
>
> http://mywiki.wooledge.org/BashFAQ/091

This does not work if one need to use

#!/usr/bin/env bash


-- 
Regards,
Peng