Linda Walsh <[email protected]> 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 $fn () { echo $fn ; }" ## but same statement, eval'd works
That's not the same statement. The same statement would be
def='function $fn () { echo $fn ; }'
Andreas.
--
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."