bug-bash
[Top][All Lists]
Advanced

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

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


From: Andreas Schwab
Subject: Re: `declare -f "a="' fails unnecessarily
Date: Sun, 04 Dec 2022 21:56:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

On Dez 04 2022, Dale R. Worley wrote:

> 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

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



reply via email to

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