Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Weird behavior with redirecting stdin
- X-seq: zsh-users 24195
- From: Aryn Starr <whereislelouch@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Weird behavior with redirecting stdin
- Date: Mon, 2 Sep 2019 18:28:27 +0430
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1567432713; bh=4XCUA22kPvFDMXEv7iQDA9aHutemnHOzoTq2g8CssXk=; h=From:Content-Type:Subject:Message-Id:Date:To; b=rpgQfi1sZgbTQZuEaKnt+7IufeuJ8Mpi+AeclwL2irJCQxFDgUbmFavmJIbfFMrJ8 95v1GZepYp0oCwbsCAZQ1EMJYFeWc+J0hfz9rwpq1vZDvCfEzyr8WiRyxXJn5kTFsc BgNayczEOOtBZD4jZI+xgT4unMyUXpBqfwEK+hwowpGG1s/uNu2DsxZp3poj8ncI31 Fh14CSIUbRVHPMwuF+BQE0m+MnLymocSwjSB2TneMrPRa+/RliSog5gEO7HvDMFeQC ZnU+CP8kpzWvpe417C1cE2W0mB/vCCkgdhsdj/E9NyI3lHJZqE1vQ/evMrCHT8IReK HRZCsjYoNTFUA==
- 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
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