zsh-users
 help / color / mirror / code / Atom feed
* Capturing "jobs" output.
@ 1997-01-08 21:32 Xris Laas
  1997-01-09  2:19 ` Zoltan Hidvegi
  0 siblings, 1 reply; 2+ messages in thread
From: Xris Laas @ 1997-01-08 21:32 UTC (permalink / raw)
  To: zsh-users


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 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-01-09  2:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-08 21:32 Capturing "jobs" output Xris Laas
1997-01-09  2:19 ` Zoltan Hidvegi

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).