Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh function declaration bug



On 30 Jan 2019, at 11:46, Mitchell Gildenberg <mgild@xxxxxxxxxx> wrote:
>➜ mgild $ l(){ echo "hello"}
>zsh: defining function based on alias `ls'
>zsh: parse error near `()'

Presumably you have an alias l=ls, which is being expanded because the l in
l() { ... } is considered to be in command position. workers/40300 made this
an error by default, since the expansion behaviour is generally unexpected

If you don't need the l alias, you can just unalias it. Otherwise it will
work with the function key word like you said, or if you put the definition in
a file rather than entering it at the command line. But i'm guessing you don't
actually want an alias and a function with the same name anyway

dana



Messages sorted by: Reverse Date, Date, Thread, Author