From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10315 invoked from network); 3 Nov 2006 19:59:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Nov 2006 19:59:28 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 7088 invoked from network); 3 Nov 2006 19:59:19 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Nov 2006 19:59:19 -0000 Received: (qmail 5815 invoked by alias); 3 Nov 2006 19:59:10 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10929 Received: (qmail 5805 invoked from network); 3 Nov 2006 19:59:10 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Nov 2006 19:59:10 -0000 Received: (qmail 5814 invoked from network); 3 Nov 2006 19:59:10 -0000 Received: from ug-out-1314.google.com (66.249.92.175) by a.mx.sunsite.dk with SMTP; 3 Nov 2006 19:59:08 -0000 Received: by ug-out-1314.google.com with SMTP id k3so466800ugf for ; Fri, 03 Nov 2006 11:59:08 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZMWH86fjSPQO0un+MgqqHHTTFFAnJBL9kWXoFkh7UavHSYTR0lbTnf1TtcgKGKojIEMhrwwmUZw+QMMbNaK40IcvQhT07C41drnnG6rpRfTRljzjrabY5WY5OuDi9odAexld5Q7hCdyEU64/Cc72RONilh/wZmsyAwzRKW7W/vw= Received: by 10.82.131.1 with SMTP id e1mr876571bud.1162583947631; Fri, 03 Nov 2006 11:59:07 -0800 (PST) Received: by 10.82.164.2 with HTTP; Fri, 3 Nov 2006 11:59:04 -0800 (PST) Message-ID: <17393e3e0611031159n61dec831q7ca0ce6ccfb8a421@mail.gmail.com> Date: Fri, 3 Nov 2006 14:59:07 -0500 From: "Matt Wozniski" Reply-To: mjw@drexel.edu To: zsh-users@sunsite.dk Subject: Re: jobs -d &>/dev/null still produces output? In-Reply-To: <20061103194239.9587ede2.pws@csr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <17393e3e0611031048j2c28e9b4w996c1690926d7b95@mail.gmail.com> <20061103194239.9587ede2.pws@csr.com> On a machine that I can't use the latest cvs on: Is there any sort of file descriptor magic that I can use to work around this and get it to send that to somewhere other than the terminal, or am I just stuck with its current behavior? On 11/3/06, Peter Stephenson wrote: > "Matt Wozniski" wrote: > > I'm a bit confused by something zsh is doing. > > > > Test case: > > > > sleep 1000 & > > jobs -d &>/dev/null > > > > Why does this still produce output? > > The line you're seeing is the same line that would usually be produced > when, for example, you run "fg" and the process that's brought to the > foreground is running in a different directory. Since this is purely an > interactive informational message it's directed straight to the terminal. > > It's less useful when this happens in the "jobs" command, however, since in > that case the above doesn't apply and you'd expect the output to appear in > one place. I think it would be more consistent to do what we already > do with other output and send it to stdout rather than the terminal if > it's run from "jobs". > > Index: Src/jobs.c > =================================================================== > RCS file: /cvsroot/zsh/zsh/Src/jobs.c,v > retrieving revision 1.48 > diff -u -r1.48 jobs.c > --- Src/jobs.c 30 Oct 2006 10:37:18 -0000 1.48 > +++ Src/jobs.c 3 Nov 2006 19:41:31 -0000 > @@ -954,10 +954,10 @@ > > if ((lng & 4) || (interact && job == thisjob && > jn->pwd && strcmp(jn->pwd, pwd))) { > - fprintf(shout, "(pwd %s: ", (lng & 4) ? "" : "now"); > - fprintdir(((lng & 4) && jn->pwd) ? jn->pwd : pwd, shout); > - fprintf(shout, ")\n"); > - fflush(shout); > + fprintf(fout, "(pwd %s: ", (lng & 4) ? "" : "now"); > + fprintdir(((lng & 4) && jn->pwd) ? jn->pwd : pwd, fout); > + fprintf(fout, ")\n"); > + fflush(fout); > } > /* delete job if done */ > > @@ -1827,11 +1827,12 @@ > printjob(jobtab + job, (stopped) ? -1 : lng, 1); > if (func != BIN_BG) { /* fg or wait */ > if (jobtab[job].pwd && strcmp(jobtab[job].pwd, pwd)) { > - fprintf(shout, "(pwd : "); > - fprintdir(jobtab[job].pwd, shout); > - fprintf(shout, ")\n"); > + FILE *fout = (func == BIN_JOBS) ? stdout : shout; > + fprintf(fout, "(pwd : "); > + fprintdir(jobtab[job].pwd, fout); > + fprintf(fout, ")\n"); > + fflush(fout); > } > - fflush(shout); > if (func != BIN_WAIT) { /* fg */ > thisjob = job; > if ((jobtab[job].stat & STAT_SUPERJOB) && > > > To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php >