1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

27178: FAQ---quoting function names to stop expansion is always safe

This commit is contained in:
Peter Stephenson 2009-07-20 09:02:39 +00:00
parent bda90c969f
commit 7e0ca71469
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2009-07-20 Peter Stephenson <pws@csr.com>
* 27178: Etc/FAQ.yo: as pointed out by Mikael, quoting
function names to stop alias expansion is always safe.
2009-07-19 Barton E. Schaefer <schaefer@zsh.org>
* 27169: Src/jobs.c, Src/signals.c: 23067 went too far in opening
@ -12018,5 +12023,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.4746 $
* $Revision: 1.4747 $
*****************************************************

View file

@ -819,6 +819,14 @@ label(23)
use in the body of a function, but define the function first if the
alias has the same name as the function.
If you aware of the problem, you can always escape part or all of the
name of the function:
verb(
'l'() { /bin/ls -la "$@" | more }
)
Adding the quotes has no effect on the function definition, but
suppresses alias expansion for the function name. Hence this is
guaranteed to be safe.
sect(Similarities with tcsh)