[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `declare -f "a="' fails unnecessarily

From: Dale R. Worley
Subject: Re: `declare -f "a="' fails unnecessarily
Date: Mon, 05 Dec 2022 11:53:40 -0500

Andreas Schwab <schwab@linux-m68k.org> writes:
>> In default mode, you actually can do
>>     $ function a=b { printf hi\\n; }
>> though you can't execute it:
>>     $ a=b foo
>>     bash: foo: command not found
> You just have to quote any part of the function name upto the equal sign
> to stop if from being interpreted as an assignment.
> $ \a=b foo
> hi

Oh, wow!  I guess that makes sense but I'd never imagine that one would
want it to make sense!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]