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

Re: Bug? piping ls to anonymous function changes subsequent behaviour of ls



On Sun, Sep 27, 2020 at 6:02 PM vapnik spaknik <vapniks@xxxxxxxxx> wrote:
>
> From a new shell:
> > which -a ls
> ls: aliased to ls --color=auto
> /bin/ls
> > /bin/ls | () {echo foo}
> foo
> > /bin/ls
> foo
> > which /bin/ls
> /bin/ls () {
> echo foo
> }

Something else funny is happening here.  This is defining /bin/ls as a
function with body "echo foo", as if the "|" were not present in the
command at all.

Try using "set -x" (or "setopt xtrace" if you prefer) before the first
attempt to pipe.




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