zsh-users
 help / color / mirror / code / Atom feed
From: Xris Laas <chrisl@cybercom.net>
To: zsh-users@math.gatech.edu
Subject: Capturing "jobs" output.
Date: Wed, 8 Jan 1997 16:32:45 -0500 (EST)	[thread overview]
Message-ID: <199701082131.QAA07465@orion.cybercom.net> (raw)


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 }



             reply	other threads:[~1997-01-08 21:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-08 21:32 Xris Laas [this message]
1997-01-09  2:19 ` Zoltan Hidvegi

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=199701082131.QAA07465@orion.cybercom.net \
    --to=chrisl@cybercom.net \
    --cc=zsh-users@math.gatech.edu \
    /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).