Re: 'official function declaration format' doesn't work if alias defined

2016-01-09 Thread Eric Cook
In mksh, ksh93, zsh and maybe others, you can use quotes to suppress alias expansions during definition just like you would a simple command; unfortunately bash deems it a invalid identifier.

extglob patterns and dotfiles

2017-12-29 Thread Eric Cook
When using an pattern that begin with an period in pattern-list, bash will include dotfiles in the results. This doesn't seem to be the case with the various korn shells that i have seen. Since extglob is based on ksh's extension to globbing, this appears to be an bug. $ shopt -s extglob;

Re: extglob patterns and dotfiles

2017-12-31 Thread Eric Cook
On 12/31/2017 01:47 PM, Chet Ramey wrote: > On 12/29/17 6:55 PM, Eric Cook wrote: >> When using an pattern that begin with an period in pattern-list, bash will >> include dotfiles in the results. >> This doesn't seem to be the case with the various korn shells that i have &

Re: extglob patterns and dotfiles

2018-01-02 Thread Eric Cook
On 01/02/2018 10:30 AM, Chet Ramey wrote: > On 12/31/17 10:36 PM, Eric Cook wrote: > >> So to make my request more specific, i don't think the extglob !() should >> match dotfiles when one of the patterns in the list is preceded with an >> period. >> to be more ks

Re: Following symlinks in globstar (part 2)

2018-04-11 Thread Eric Cook
On 04/11/2018 10:57 AM, Chet Ramey wrote: > Yep, that's an incompatibility. The `c.c' thing in the original report is > just a red herring, though. > > Chet > If you are aiming for compatibility with zsh, the fact that `echo **' recurses is also a bug.

Re: echo builtin doesn't handle end-of-options flag

2020-08-16 Thread Eric Cook
On 8/16/20 11:47 AM, Todd A. Jacobs wrote: Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: darwin19.5.0 Compiler: clang Compilation CFLAGS: -DSSH_SOURCE_BASHRC -Wno-parentheses -Wno-format-security uname output: Darwin titan.local 19.6.0 Darwin Kernel

Re: zsh style associative array assignment bug

2021-03-28 Thread Eric Cook
On 3/28/21 7:02 AM, Oğuz wrote: As it should be. `[bar]' doesn't qualify as an assignment without an equals sign, the shell thinks you're mixing two forms of associative array assignment there. In the new form, that a key is listed inside a compound assignment alone implies that it was meant

Re: zsh style associative array assignment bug

2021-03-29 Thread Eric Cook
On 3/29/21 5:18 PM, Chet Ramey wrote: If you look at a=( k1 v1 k2 v2 k3 v3) as more or less syntactic sugar for a=( [k1]=v1 [k2]=v2 [k3]=v3 ) it's reasonable that a=( k1 v1 k2 ) is equivalent to a=( [k1]=v1 [k2]= ). And that's what bash does. Its just when populating that array

Re: zsh style associative array assignment bug

2021-03-30 Thread Eric Cook
On 3/30/21 10:54 AM, Chet Ramey wrote: > On 3/29/21 6:40 PM, Eric Cook wrote: >> Its just when populating that array dynamically with another array >> if that second array didn't contain `v1' hypothetically, the array gets >> shifted to > > OK, how would you do that? W

Re: zsh style associative array assignment bug

2021-03-31 Thread Eric Cook
On 3/30/21 3:44 PM, Chet Ramey wrote: Is this a serious piece of code, or just one to demonstrate a programming error? The latter There is only one field, terminated by `|', which becomes one array element. This is where you `lose' the null elements, not when you attempt to copy. Nothing you

zsh style associative array assignment bug

2021-03-27 Thread Eric Cook
Hey, When doing an assignment with an uneven number of elements bash currently silently treat the last element as a key and assigns it an empty string. $ typeset -A ary=(this feature came from zsh); typeset -p ary declare -A ary=([came]="from" [this]="feature" [zsh]="" ) In zsh this is an

Re: zsh style associative array assignment bug

2021-03-28 Thread Eric Cook
On 3/28/21 12:25 AM, Oğuz wrote: Why? I think it's better this way. -- Oğuz 1) For consistency sake with the shell the idea was borrowed from mostly. 2) Prior to this extension bash required specifying the key and value for AA assignments, so it seems weird to silently ignore that a value