[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issues with exported functions
From: |
Gabriel Corona |
Subject: |
Re: Issues with exported functions |
Date: |
Thu, 25 Sep 2014 10:52:12 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Hello,
As the interface is not specified, would it make sense to:
* add a prefix (use BASH_FUNCTION_foo instead of foo for exported
function foo);
* still expand the variable if it matches the 'exported function'
pattern.
The first point would reduce the probability of a clash with
a user variable:
foo() {
echo Executing function "$@"
}
foo="aa"
export -f foo
export foo
bash -c foo
# OK
bash -c 'echo $foo'
# OK as well
bash -c env
# In fact the environment variable is set twice, I didn't know it was event
possible
dash -c 'echo $foo'
# Dash find the second one: () { echo Executing function "$@" }
The second (more important) point would allow a variable to begin with
"() {}" or similar:
$ x="() {}" bash -c 'echo $x' 2>/dev/null
$ x="() {}" dash -c 'echo $x' 2>/dev/null
() {}
--
Gabriel
- Re: Issues with exported functions, (continued)
- Re: Issues with exported functions, lolilolicon, 2014/09/25
- Re: Issues with exported functions, Pierre Gaston, 2014/09/25
- Re: Issues with exported functions, lolilolicon, 2014/09/25
- Re: Issues with exported functions, Pierre Gaston, 2014/09/25
- Re: Issues with exported functions, lolilolicon, 2014/09/25
- Re: Issues with exported functions, Chet Ramey, 2014/09/25
- Re: Issues with exported functions, lolilolicon, 2014/09/25
- Re: Issues with exported functions, Linda Walsh, 2014/09/25
- Re: Issues with exported functions, lolilolicon, 2014/09/25
- Re: Issues with exported functions, Steve Simmons, 2014/09/24
- Re: Issues with exported functions,
Gabriel Corona <=
- Re: Issues with exported functions, Gabriel Corona, 2014/09/25
- Re: Issues with exported functions, Chet Ramey, 2014/09/25
- Re: Issues with exported functions, Dan Douglas, 2014/09/25
- Re: Issues with exported functions, Chet Ramey, 2014/09/25
- Re: Issues with exported functions, Dan Douglas, 2014/09/25
- Re: Issues with exported functions, Eric Blake, 2014/09/25
- Re: Issues with exported functions, Gabriel Corona, 2014/09/25
- Re: Issues with exported functions, Gabriel Corona, 2014/09/25
- Re: Issues with exported functions, Ángel González, 2014/09/25
- Re: Issues with exported functions, lolilolicon, 2014/09/25