From: Pier Paolo Grassi <pierpaolog@gmail.com>
To: Aryn Starr <whereislelouch@icloud.com>
Cc: Zsh-Users List <zsh-users@zsh.org>
Subject: Re: Weird behavior with redirecting stdin
Date: Mon, 2 Sep 2019 16:00:41 +0200 [thread overview]
Message-ID: <CAP+y1xBd7pD_6gQkXbTGzzoRvprCCEsU6r4HUDWubVt3D+8HOw@mail.gmail.com> (raw)
In-Reply-To: <3A161CB3-442A-4E0B-9A0E-1C62A72DF6DB@icloud.com>
[-- Attachment #1: Type: text/plain, Size: 976 bytes --]
hello, anyone has suggestions on this?
regards
Il giorno lun 2 set 2019 alle ore 15:59 Aryn Starr <
whereislelouch@icloud.com> 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 ...
next prev parent reply other threads:[~2019-09-02 14:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-02 13:58 Aryn Starr
2019-09-02 14:00 ` Pier Paolo Grassi [this message]
2019-09-02 14:36 ` Roman Perepelitsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAP+y1xBd7pD_6gQkXbTGzzoRvprCCEsU6r4HUDWubVt3D+8HOw@mail.gmail.com \
--to=pierpaolog@gmail.com \
--cc=whereislelouch@icloud.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).