On 09/27/2014 02:57 PM, Arfrever Frehtes Taifersar Arahesis wrote: > 2014-09-27 22:29 Eric Blake napisał(a): >> Thankfully, bash already forbids trying to name a function 'a=b' > > It works in bash 4.3.26: > > $ function a=b() { echo A; } > $ "a=b" > A
Oh, you used the 'function' keyword, coupled with NOT quoting the name of the function. I was trying to create the name via quotation: $ bash -c 'a\=b () { echo hi; }; a\=b' bash: `a\=b': not a valid identifier bash: a=b: command not found Still, since I strongly believe that import/export and valid function names should be the same set of characters, but that it would be extremely difficult to unambiguously encode = into environment variable function names, I think that we SHOULD take the step of forbidding '=' in function names (the 'function' keyword should NOT be able to define any function that cannot also be defined in isolation, nor which cannot be imported from the environment using whatever improved implementation we decide for function export/import). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature