From owner-freebsd-questions Sun Oct 21 23:56:14 2001 Delivered-To: freebsd-questions@freebsd.org Received: from shumai.marcuscom.com (rdu57-28-046.nc.rr.com [66.57.28.46]) by hub.freebsd.org (Postfix) with ESMTP id ABCD737B403 for ; Sun, 21 Oct 2001 23:56:09 -0700 (PDT) Received: from localhost (marcus@localhost) by shumai.marcuscom.com (8.11.6/8.11.6) with ESMTP id f9M6u0s18122; Mon, 22 Oct 2001 02:56:00 -0400 (EDT) (envelope-from marcus@marcuscom.com) X-Authentication-Warning: shumai.marcuscom.com: marcus owned process doing -bs Date: Mon, 22 Oct 2001 02:56:00 -0400 (EDT) From: Joe Clarke To: Matthew Blacklow Cc: freebsd-questions@FreeBSD.ORG Subject: Re: C clue on FreeBSD In-Reply-To: Message-ID: <20011022025459.X11121-100000@shumai.marcuscom.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 22 Oct 2001, Matthew Blacklow wrote: > Hi all, > I am running FreeBSD and am trying to learn C. I have a program at the > moment which using C's "system" function launches a FreeBSD application. The > problem is that it outputs to the screen all the output of the spawned > process. I need to know how to supress the output of this process. I have > looked through many C programming books and on the web and cant seem to find > what i am looking for. Try: system("/my/app 2>&1 >/dev/null"); That will redirect all stdout and stderr to /dev/null, thus making your program silent. Joe > > All help appreciated > > > Thanks, > Matthew > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message