bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: doesn't bash do variable subst. or quote removal on function stateme


From: Linda Walsh
Subject: Re: doesn't bash do variable subst. or quote removal on function statement
Date: Tue, 12 Jan 2016 11:52:47 -0800
User-agent: Thunderbird



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_ to be
of similar syntax.


I.e.:

declare  "ab=1"   "ab"=1   ab"=1"  a"b=1"  "a"b=1   a"b"=1   ab"=1"
 all appear to do quote removal, making them equivalent to
declare ab=1

vs. for function, where
one has:
 function a {(echo hi)}

then one might think, _at least_, that some similar syntax would
work like:

function "a" {(echo hi)}  function "a" "{(echo hi)}"

or even

declare -f a="{(echo hi)}"

_might_ work.

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....











reply via email to

[Prev in Thread] Current Thread [Next in Thread]