On 1/13/16 12:20 PM, Linda Walsh wrote:
> It doesn't seem very consistent to choose (()) over [] -- why come up with
> a special longer operator for arith eval, when [] was already used for
> arith evaluation in array indexing?
http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.ht
Chet Ramey wrote:
On 1/12/16 4:33 PM, Linda Walsh wrote:
---
But why? It's less noisy than any alternative.
It's not as if I can type echo $(1+2) and expect it to work.
Because it only ever appeared in a Posix draft standard, and there's no
reason not to use the standard syntax.
On 1/12/16 4:33 PM, Linda Walsh wrote:
>
>
> Greg Wooledge wrote:
>> On Tue, Jan 12, 2016 at 11:52:47AM -0800, Linda Walsh wrote:
>>
>>> Also, from a documentation standpoint, not all behaviors are documented
>>> in the manpage, like:
>>>
>>> echo $[1+2]
>>>
>>> as far as I can tell, isn't docu
On 1/12/16 2:52 PM, Linda Walsh wrote:
>
>
> Chet Ramey wrote:
>> No. The shell doesn't perform any word expansions on the `name' when
>> executing a function definition command. Since the documentation doesn't
>> say it performs any expansions, why would you assume it does?
>>
> Because it
Greg Wooledge wrote:
On Tue, Jan 12, 2016 at 11:52:47AM -0800, Linda Walsh wrote:
Also, from a documentation standpoint, not all behaviors are documented
in the manpage, like:
echo $[1+2]
as far as I can tell, isn't documented, yet not supporting
its behavior would break many older script
On Tue, Jan 12, 2016 at 11:52:47AM -0800, Linda Walsh wrote:
> Also, from a documentation standpoint, not all behaviors are documented
> in the manpage, like:
>
> echo $[1+2]
>
> as far as I can tell, isn't documented, yet not supporting
> its behavior would break many older scripts
That syn
Chet Ramey wrote:
No. The shell doesn't perform any word expansions on the `name' when
executing a function definition command. Since the documentation doesn't
say it performs any expansions, why would you assume it does?
Because it does quote quote removal on other statements that _seem_
On 1/9/16 8:28 PM, Linda Walsh wrote:
>Not in a function definition (i.e. this is broken AFAIAC in bash).
It's not.
> I.e.
>> 'func' () { :; }
> -bash: `'func'': not a valid identifier
>> function 'func' () { : ; }
> -bash: `'func'': not a valid identifier
>> function "func" () { :; }
> -
Linda Walsh writes:
>> shopt -s expand_aliases; alias my=declare
>> declare fn=myfunc## function name in variable
> doesn't work
>> function $fn { echo $fn ; }
> -bash: `$fn': not a valid identifier
>>my -pf myfunc
> -bash: declare: myfunc: not found
>>
>> def="function $