[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....
- Re: aliases v. functions; command extension? (-f & -F)?, (continued)
- Re: aliases v. functions; command extension? (-f & -F)?, Linda Walsh, 2016/01/08
- doesn't bash do variable subst. or quote removal on function statement, Linda Walsh, 2016/01/09
- Re: doesn't bash do variable subst. or quote removal on function statement, Andreas Schwab, 2016/01/10
- Re: differences in Q.-removal, var-expansion and allowed characters in fn & var names, Linda Walsh, 2016/01/10
- Re: differences in Q.-removal, var-expansion and allowed characters in fn & var names, Chet Ramey, 2016/01/11
- Re: doesn't bash do variable subst. or quote removal on function statement, Chet Ramey, 2016/01/11
- Re: doesn't bash do variable subst. or quote removal on function statement,
Linda Walsh <=
- Re: doesn't bash do variable subst. or quote removal on function statement, Greg Wooledge, 2016/01/12
- Re: doesn't bash do variable subst. or quote removal on function statement, Linda Walsh, 2016/01/12
- Re: doesn't bash do variable subst. or quote removal on function statement, Chet Ramey, 2016/01/13
- Re: doesn't bash do variable subst. or quote removal on function statement, Linda Walsh, 2016/01/13
- Re: doesn't bash do variable subst. or quote removal on function statement, Chet Ramey, 2016/01/13
- Re: doesn't bash do variable subst. or quote removal on function statement, Chet Ramey, 2016/01/13
- Re: aliases v. functions; command extension? (-f & -F)?, Chet Ramey, 2016/01/11
- Re: aliases v. functions; command extension? (-f & -F)?, Reuti, 2016/01/11
- Re: aliases v. functions; command extension? (-f & -F)?, Chet Ramey, 2016/01/11
Re: 'official function declaration format' doesn't work if alias defined, Eric Cook, 2016/01/09