Expand first before asking the question "Display all xxx possibilities?"

2020-08-02 Thread 積丹尼 Dan Jacobson
Instead of $ zz /jidanni_backups/da Display all 113 possibilities? (y or n) n and then finally showing $ zz /jidanni_backups/dan_home_bkp how about doing the expansion first, so entering $ zz /jidanni_backups/da would then change into $ zz /jidanni_backups/dan_home_bkp with below it the

Re: Issue with Bash

2020-08-02 Thread Chet Ramey
On 7/31/20 7:27 PM, Ángel wrote: > On 2020-07-31 at 10:13 -0400, Chet Ramey wrote: >> >> I'm going to have to test some more. When I tried it, all the shells >> died. >> (I did send the SIGHUP from another terminal.) I was using ksh93 as >> the parent and bash-5.0.18 as the interactive bash,

Re: Issue with Bash

2020-08-02 Thread Chet Ramey
On 7/31/20 10:04 AM, Ayappan P2 wrote: > We are passing SIGHUP from another terminal ( not from the terminal which > has the interactive bash shell) . The terminal which has the interactive > bash closes immediately. > > The scenario is we just open two terminals. In one terminal , just invoke >

Re: set -u not working as expected

2020-08-02 Thread Chet Ramey
On 8/2/20 4:01 AM, Oğuz wrote: > $ set -u > $ unset foo bar > $ typeset -i foo bar > $ > $ foo+=foo+1 > $ > $ foo+=bar+1 > bash: bar: unbound variable > > Only referencing `bar' triggers the _unbound variable_ error, it makes > sense that the name being assigned

Re: set -u not working as expected

2020-08-02 Thread Chet Ramey
On 8/2/20 3:34 AM, Lawrence Velázquez wrote: >>> % bash -c 'set -u; typeset -i v; v+=1; printf "<%s>\\n" "$v"' >>> <1> >>> % ksh -c 'set -u; typeset -i v; v+=1; printf "<%s>\\n" "$v"' >>> <1> >>> % zsh -c 'set -u; typeset -i v; v+=1; printf "<%s>\\n" "$v"' >>> <1> > > ...which contrasts with the

Re: set -u not working as expected

2020-08-02 Thread Chet Ramey
On 8/1/20 8:47 PM, Lawrence Velázquez wrote: >> let v+=1 # Line 18, Once line 11 is uncommented, Bash fails here > > I haven't seen the code for arithmetic expansion, but I assume it > treats v+=1 as morally equivalent to v=${v}+1 (à la C99). Thus there > *is* an expansion, which fails under set

Re: set -u not working as expected

2020-08-02 Thread Chet Ramey
On 8/1/20 2:48 PM, Kristof Burek wrote: > Bash Version: 5.0 > Patch Level: 3 > Release Status: release > > (Machine is a Raspberry Pi running Raspbian "Buster") > > Description: > After set -u in a script: when x has not yet been bound to a value, > I would expect the

Re: bashbug's default editor

2020-08-02 Thread Chet Ramey
On 7/31/20 11:26 AM, Eli Schwartz wrote: >>> "If EDITOR is not set, bashbug attempts to locate a number of >>> alternative editors, including emacs, and defaults to vi." >>> >>> The word "defaults" there implies that vi is the preferred autolocated >>> editor, but the intention is to have it the

Re: set -u not working as expected

2020-08-02 Thread Oğuz
However, > In arithmetic evaluation context, if a variable for which the integer attribute is set appears at the LHS of an assignment operator, it shouldn't be expanded. would be a reasonable feature request I guess. -- Oğuz

Re: set -u not working as expected

2020-08-02 Thread Oğuz
2 Ağustos 2020 Pazar tarihinde Lawrence Velázquez yazdı: > > On Aug 2, 2020, at 2:51 AM, Oğuz wrote: > > > > `u' has no members, so there's nothing to expand. If you use `${u[0]}' > for > > example, you'll see an error, I think how bash and ksh behave is > perfectly > > reasonable. > > Agreed.

Re: set -u not working as expected

2020-08-02 Thread Lawrence Velázquez
> On Aug 2, 2020, at 2:51 AM, Oğuz wrote: > > `u' has no members, so there's nothing to expand. If you use `${u[0]}' for > example, you'll see an error, I think how bash and ksh behave is perfectly > reasonable. Agreed. Their behavior logically follows from POSIX's carveout for $@. >> % bash

Re: set -u not working as expected

2020-08-02 Thread Oğuz
2 Ağustos 2020 Pazar tarihinde Lawrence Velázquez yazdı: > > On Aug 1, 2020, at 8:47 PM, Lawrence Velázquez wrote: > > > > Presumably none of these shells implements u+=(t) as u=("${u[@]}" t). > > Granted, they do disagree on ${u[@]}. > > % bash -c 'set -u; unset u; u=("${u[@]}" t); typeset -p