From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17574 invoked from network); 8 Jan 1997 21:58:08 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 8 Jan 1997 21:58:08 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id QAA03267; Wed, 8 Jan 1997 16:56:31 -0500 (EST) Resent-Date: Wed, 8 Jan 1997 16:30:58 -0500 (EST) Message-Id: <199701082131.QAA07465@orion.cybercom.net> Date: Wed, 8 Jan 1997 16:32:45 -0500 (EST) From: Xris Laas Sender: Chris Laas Reply-To: chrisl@cybercom.net Subject: Capturing "jobs" output. To: zsh-users@math.gatech.edu MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Resent-Message-ID: <"VZNph.0.6i.I81ro"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/590 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I have noticed some unexpected behavior in the "jobs" builtin. It is possible to redirect its output to a file, but any piping of any sort fails miserably. Note these examples: --------------------------------- % jobs [1] + suspended (tty input) cat [2] running sig-updater % jobs > foo.tmp % cat foo.tmp [1] + suspended (tty input) cat [2] running sig-updater % jobs | cat % echo $(jobs) % cat <(jobs) % cat =(jobs) --------------------------------- I found the "cat =(jobs)" lack of output especially surprising, since I would expect it to be equivalent to "jobs > /tmp/xxx ; cat /tmp/xxx". Clearly, at some point, the output is not being redirected, or maybe is not being printed at all. I looked through the source of builtins.c and jobs.c, but the "fout" variable seems to check out OK. I'm not familiar with Zsh internals, but I'd guess that one of those nested if's in printjob() (jobs.c) is filtering out the redirections before anything is printed. I can work around it for now by just using a temp file, but could someone look into this? Thanks, --Xris -- ... that whenever any form of government becomes destructive of these ends, it is the right of the people to alter or to abolish it, and to institute new government, laying its foundation on such principles, and organizing its powers in such form, as to them shall seem most likely to effect their safety and happiness. -- Thomas Jefferson, Prologue, "Declaration of Independence" { Chris "Xris" Laas }----{ chrisl@cybercom.net }----{ xris@qfl.com }