Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: Redirecting shell output to a pipe
- X-seq: zsh-users 14605
- From: <Norman.Azadian@xxxxxxxxxxxx>
- To: <zsh-users@xxxxxxx>
- Subject: RE: Redirecting shell output to a pipe
- Date: Wed, 25 Nov 2009 14:51:33 +0100
- Accept-language: en-US, de-CH
- Acceptlanguage: en-US, de-CH
- In-reply-to: <20091125134441.GA25464@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- 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
- References: <20091124143140.GA7612@xxxxxxxxxxxxxxxxxxxxxxxxxx> <4B0C2709.5080307@xxxxxxx> <20091125064801.GA8371@xxxxxxxxxxxxxxxxxxxxxxxxxx> <200911251252.48892.joke.de.buhr@xxxxxxxxx> <20091125134441.GA25464@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Thread-index: Acpt1fOvGJMrNVUlQPahZ0oMhr2JdgAAFPLg
- Thread-topic: Redirecting shell output to a pipe
What you want is typescript.
NHA
---
Norman H. Azadian SCS-NIT-DEV-PCI-FUF-NSP-SIA (EXT)
Swisscom AG Zentweg 9 CH-3006 Ostermundigen
+41 31 342 2141 norman.azadian@xxxxxxxxxxxx
-----Original Message-----
From: Nadav Har'El [mailto:nyh@xxxxxxxxxxxxxxxxxxx]
Sent: Wednesday, November 25, 2009 2:45 PM
To: Joke de Buhr
Cc: zsh-users@xxxxxxx
Subject: Re: Redirecting shell output to a pipe
Hi,
On Wed, Nov 25, 2009, Joke de Buhr wrote about "Re: Redirecting shell output to a pipe":
> > > exec |& tee filename
>
> you should replace exec with a command. NOT the "exec" builtin. using the
> builtin exec command doesn't make much sense in this context:
I think there was a misunderstanding here. When I used the word "exec" I
didn't mean it as a replacement for any executable, but rather the specific
keyword "exec". I know all about the syntax for redirection of ordinary
commands (I've been using Unix shells for the past 25 years ;-)).
What I was asking was not about redirecting an invidual command, but rather
redirecting all the shell's output, from now on. The syntax to do that
for redirection to a file is:
exec > filename
Just like that - with the keyword "exec". It's a bizarre syntax, I admit,
but one that has existed for decades (it is not a zsh-specific feature).
My question was how do you do that - i.e., redirection of all the shell's
output - but not to a file but rather a command, e.g., the command
"tee filename". I was hoping that the following would work:
exec | tee filename
would work, but it doesn't, and I was wondering if anybody knew why - is
this an oversight or deliberate. I also gave a working, but way too difficult
alternative to achieve the same thing using a coprocess.
Thanks,
Nadav.
--
Nadav Har'El | Wednesday, Nov 25 2009, 8 Kislev 5770
nyh@xxxxxxxxxxxxxxxxxxx |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |:(){ :|:&};: # DANGER: DO NOT run this,
http://nadav.harel.org.il |unless you REALLY know what you're doing!
Messages sorted by:
Reverse Date,
Date,
Thread,
Author