[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issues with exported functions
From: |
Geir Hauge |
Subject: |
Re: Issues with exported functions |
Date: |
Thu, 25 Sep 2014 09:55:56 +0200 |
2014-09-25 6:23 GMT+02:00 Linda Walsh <bash@tlinx.org>:
>
> Maybe exporting fun?
>
> export fun='() { :;}'
>> bash -c 'declare -pf fun'
>>
> bash: line 0: declare: fun: not found
> ...
> I've never seen functions created with an assignment. Is this a
> new syntax in 4.3?
>
> (still in 4.2.43 here)...
Bash has had this feature since "forever"
$ fun='() { echo "$BASH_VERSION";}' bash1 -c fun
1.14.7(1)
Your bash 4.2.43 is no exception, but the way declare's -p and -f
options interact did change in 4.3, so try with just ''declare -f fun''
instead
--
Geir Hauge