Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
reopening/resetting/tee'ing pipes?
- X-seq: zsh-users 16201
- From: Aaron Davies <aaron.davies@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: reopening/resetting/tee'ing pipes?
- Date: Mon, 8 Aug 2011 21:49:31 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; bh=2MZz/fWyYN2Bx240LxayaTNt52KUiOT+pL+7AC8uhsU=; b=vfoCX7egd9l3ZJ97ik3aqoxN07kPC7od2h042gqhI6Tglri94Z5SMcaKN6ZwOp0BfG ExeUkI+Yw7pcihSCb90gnhgU8jGoF0JMGfGZMrnalhcSwa9eyzj/xzwT5fiy8Ay3iReC 0V1q88nf0CxdnWdeTMQJrMYLeP6s6IEmeoRfE=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
% cat bar.sh
#!/bin/zsh
echo 1
cat $1
echo 2
cat $1
echo 3
% ./bar.sh <(echo foo)
1
foo
2
3
is it possible to get another "foo" between 2 & 3 there given that i'm reading from a pipe? (both portable and zsh-only solutions are welcome)
essentially it feels like it ought to be possible to make bar.sh behave identically with a pipe and with a plain file
% echo foo>foo
% ./bar.sh foo
1
foo
2
foo
3
--
Aaron Davies
aaron.davies@xxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author