Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Weird behavior with redirecting stdin
- X-seq: zsh-users 24196
- From: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
- To: Aryn Starr <whereislelouch@xxxxxxxxxx>
- Subject: Re: Weird behavior with redirecting stdin
- Date: Mon, 2 Sep 2019 16:00:41 +0200
- Cc: Zsh-Users List <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7xnzCfCAYuHXwXgGiO9UI8/Ibfzs/sV6BU0qSyptp1M=; b=pnkxQPr91/oTEq+QhjgruXeWjf5c9x0aP6Hr9O/LXJV8qY/j8FwfyQMUb6vBKyuZ0g 8tSsAatY18LFWTW9mRLkNXHlT19Xn6bxhsaWskhWrN2DLIJPs9sas1Lxa0ivZ/kEd6qU 9uzwwrysiPTVSZX2J3hneNN6mtikCCJ9vdJq6yX4VYjiAM9KMa9+POPqfywXZSQZZUa6 svsOs2rdUPbN+U4ah1EpHy6R2t7KA/JnTQvuddKAUKcZQc+u+cdYhP+nwSmNMmTCMUNG zqVxpylj7PF/22e2oGf1zDVnaEciADre6cZDM+Ir0kB59sa2IfmJ7tMhZHv70vnh3V6J 4boA==
- In-reply-to: <3A161CB3-442A-4E0B-9A0E-1C62A72DF6DB@icloud.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <3A161CB3-442A-4E0B-9A0E-1C62A72DF6DB@icloud.com>
hello, anyone has suggestions on this?
regards
Il giorno lun 2 set 2019 alle ore 15:59 Aryn Starr <
whereislelouch@xxxxxxxxxx> ha scritto:
> With these functions:
>
> ```
> fcm () {
> # Function for selecting a command interactively
> echo ${(F)commands} | fzf
> }
>
> teec () {
> # Dumbed down version of a function that both echoes and copies to
> clipboard. (Current toy version just echoes.)
> local out="$(</dev/stdin)"
> print -r -- "$out"
> }
> ```
>
> I can do `fcm | teec` and it works correctly.
> However, if I change `teec` to this:
>
> ```
> teec () {
> echo 'echo hi' | { eval "$(</dev/stdin)" }
> local out="$(</dev/stdin)"
> print -r -- "$out"
> }
> ```
>
> Then running `fcm | teec` hangs (after printing `hi`) and doesn’t even get
> interrupted with ^D or ^C.
> I don’t understand why these problems occur at all, and I have no idea how
> to go about fixing them ...
Messages sorted by:
Reverse Date,
Date,
Thread,
Author