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

Re: Problem with user function



On Fri, Feb 23, 2024 at 10:32 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Fri, Feb 23, 2024 at 7:16 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> >
> > You can't have an alias like that inside a function.
>
> You can. Try it.

Ray is confusing the error message, with the difference between this:

alias ls='ls -A'
nls() { ls ~/notes/${1} }

And this:

nls() { ls ~/notes/${1} }
alias ls='ls -A'

In the latter example, "nls" will not use the alias, whereas in the
former example, it will.

Zsh does not issue a warning for either of those examples, though.




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