Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug? piping ls to anonymous function changes subsequent behaviour of ls
- X-seq: zsh-users 26092
- From: vapnik spaknik <vapniks@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Bug? piping ls to anonymous function changes subsequent behaviour of ls
- Date: Mon, 28 Sep 2020 01:02:06 +0000 (UTC)
- Archived-at: <https://zsh.org/users/26092>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-09/1678353929.1101107.1601254926037%40mail.yahoo.com>
- Authentication-results: zsh.org; iprev=pass (sonic316-55.consmr.mail.gq1.yahoo.com) smtp.remote-ip=98.137.69.31; dkim=pass header.d=yahoo.com header.s=s2048 header.a=rsa-sha256; dmarc=pass header.from=yahoo.com; arc=none
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1601254928; bh=gBPSrF0+eDI4xUrEsfaY1/mApQfLGAf7prgT0vUpDNk=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject; b=Y5IYGuVviebNenHJHf8dXt9qHSDkaUmF+aKPdXuZePrBMfgmtoRI5Y/wsVT0dRZtu/i2nVOUYi99J/x0yzytWrbNt92NWaYBgUhuFMPdF7R7fTCmgIvnAXiXcmRsJX7BKbiXm3iKzSuaxi9cYf7kANhAsgIS57TOErCNegn8jo9aVmKmnb7YavdDYAqshc4m4Irbasdom1ojMLRWGLfbSEWjYW9CmHIzSKNm2dpNSQkh/CR4IpnEGqf4fstSthNsLbpzxxqNPjvp4aH6kCkYdFdcCz4EcVTTs/HZLPoOg+gV3y8GfhLHFNo5nU8jdSkvShlwzO15GICNt+0PQXHPyA==
- In-reply-to: <CAH+w=7a2sPR8mecmaV8YuotyUJ9Ma90NxyyPrsL+SH6xJyC0yw@mail.gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-users>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-users.zsh.org>
- List-owner: <mailto:zsh-users-request@zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-users>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-users>
- References: <1846474183.1100394.1601253063804.ref@mail.yahoo.com> <1846474183.1100394.1601253063804@mail.yahoo.com> <CAH+w=7a2sPR8mecmaV8YuotyUJ9Ma90NxyyPrsL+SH6xJyC0yw@mail.gmail.com>
- Sender: zsh-users-request@xxxxxxx
On Monday, September 28, 2020, 01:41:10 AM GMT+1, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>Not reproducible for me with "zsh -f".
>Have you tried running "whence -a ls" to find out if or to what it has
>been redefined?
Yep, it was aliased, but that isn't the problem. I've found that the anonymous function is being assigned to the left hand side of the pipe, but only the first time that pipeline is run in a new shell. Very strange.
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
}
> unfunction /bin/ls
> /bin/ls
Downloads Documents etc...
> # Yay! now try again in the same shell:
> /bin/ls | () {echo foo}
foo
> /bin/ls
Downloads Documents etc...
> # back to normal behaviour!
If I start a new shell the same thing happens again, i.e. the first time I pipe to the anonymous function it is actually assigned to the left hand side, but subsequently it isn't.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author