Linda Walsh <b...@tlinx.org> 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, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to