On 11/7/16 4:49 AM, Dan Douglas wrote:
> On Sun, Nov 6, 2016 at 3:46 PM, Chet Ramey wrote:
>> On 11/1/16 5:57 AM, Dan Douglas wrote:
>>> On a possibly related note, would you consider adjusting +, :+, -, :-,
>>> as in "${var[@]+word}" to align with the meaning of [[ -v var[@] ]] as
>>> discussed i
On Sun, Nov 6, 2016 at 3:46 PM, Chet Ramey wrote:
> On 11/1/16 5:57 AM, Dan Douglas wrote:
>> On a possibly related note, would you consider adjusting +, :+, -, :-,
>> as in "${var[@]+word}" to align with the meaning of [[ -v var[@] ]] as
>> discussed in
>> https://lists.gnu.org/archive/html/bug-
On 11/1/16 5:57 AM, Dan Douglas wrote:
> On Mon, Oct 24, 2016 at 8:25 AM, Chet Ramey wrote:
>> On 10/21/16 5:41 PM, L. A. Walsh wrote:
>>> On 4.3 and earlier, at least on arrays, one could have
>>> the illusion of this working w/o complaint -- and returning
>>> 0 when the array was 0-len or unset,
On Mon, Oct 24, 2016 at 8:25 AM, Chet Ramey wrote:
> On 10/21/16 5:41 PM, L. A. Walsh wrote:
>> On 4.3 and earlier, at least on arrays, one could have
>> the illusion of this working w/o complaint -- and returning
>> 0 when the array was 0-len or unset, or the array length,
>> otherwise:
>>
>>
>>
Chet Ramey wrote:
On 10/29/16 2:04 AM, L. A. Walsh wrote:
You can claim a feature is a certain way because posix requires it
when you are operating in posix-only mode.
Not actually true. I can claim bash implements a particular feature the
way bash implements it.
---
True, but
On 10/29/16 2:04 AM, L. A. Walsh wrote:
>
>
> Chet Ramey wrote:
>> Come on, don't be willfully obtuse. You know better than this. Posix mode
>> doesn't mean "turning it off does everything the way Linda wants."
>>
> No, but claiming posix as a backing for features running that are
> not runnin
Chet Ramey wrote:
Come on, don't be willfully obtuse. You know better than this. Posix mode
doesn't mean "turning it off does everything the way Linda wants."
No, but claiming posix as a backing for features running that are
not running with posix-mode set, is equally obtuse.
Bash is not l
On 10/28/16 3:43 PM, L. A. Walsh wrote:
>
>Please, I'm not running in posix mode, so how would their rules
> apply?
Because you're using `bash', not `walsh'?
Bash is a posix shell. Would the bash documentation convince you? You
could go read that instead.
> Just because posix defines
Chet Ramey wrote:
On 10/24/16 7:32 PM, L. A. Walsh wrote:
I don't understand the ambiguity. If param= "#obj[@]", then it
is clear to me that the user wants the length of an array named "obj".
Stop there. In something like ${#obj[@]}, `param' is `obj[@]'. The
`${#param}' is a c
On 10/24/16 7:32 PM, L. A. Walsh wrote:
>I don't understand the ambiguity. If param= "#obj[@]", then it
> is clear to me that the user wants the length of an array named "obj".
Stop there. In something like ${#obj[@]}, `param' is `obj[@]'. The
`${#param}' is a clearly-defined word expansio
Chet Ramey wrote:
On 10/21/16 5:41 PM, L. A. Walsh wrote:
[previously] one could have the illusion of this working
w/o complaint -- and returning 0 when the array was 0-len
or unset, or the array length, otherwise:
echo ${#array[@]:-0}
But I note it only seemed to work in arrays, and in
On 10/21/16 5:41 PM, L. A. Walsh wrote:
> On 4.3 and earlier, at least on arrays, one could have
> the illusion of this working w/o complaint -- and returning
> 0 when the array was 0-len or unset, or the array length,
> otherwise:
>
>
> echo ${#array[@]:-0}
>
> But I note it only seemed to wor
On Fri, Oct 21, 2016 at 09:19:08PM -0700, L. A. Walsh wrote:
> Eduardo Bustamante wrote:
> >what's wrong with?:
> >echo ${#array[@]}
> Not when "-u" is set, which I often have on to help catch misspellings.
>
> set -u
> echo ${#array[@]}
> bash: array: unbound variable
See http://mywiki.wooledge
what's wrong with?:
echo ${#array[@]}
It will return:
- With array=(1 2 3) -> 3
- With array=() -> 0
- With unset array -> 0
- With declare -a array -> 0
Seems to do what you're looking for.
Eduardo Bustamante wrote:
what's wrong with?:
echo ${#array[@]}
It will return:
- With array=(1 2 3) -> 3
- With array=() -> 0
- With unset array -> 0
- With declare -a array -> 0
Seems to do what you're looking for.
Not when "-u" is set, which I often have on to help catch misspellings
On 4.3 and earlier, at least on arrays, one could have
the illusion of this working w/o complaint -- and returning
0 when the array was 0-len or unset, or the array length,
otherwise:
echo ${#array[@]:-0}
But I note it only seemed to work in arrays, and in 4.4 gets a
syntax error:
echo ${#ar
16 matches
Mail list logo