From owner-freebsd-questions@FreeBSD.ORG Sun Oct 11 21:59:01 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B12D71065670 for ; Sun, 11 Oct 2009 21:59:01 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 721938FC2A for ; Sun, 11 Oct 2009 21:59:01 +0000 (UTC) Received: from r55.edvax.de (port-92-195-71-245.dynamic.qsc.de [92.195.71.245]) by mx02.qsc.de (Postfix) with ESMTP id 9105C25439; Sun, 11 Oct 2009 23:59:00 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id n9BLwx82006007; Sun, 11 Oct 2009 23:58:59 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sun, 11 Oct 2009 23:58:59 +0200 From: Polytropon To: Stefan Miklosovic Message-Id: <20091011235859.69bb0a08.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: error output redirection X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2009 21:59:01 -0000 On Sun, 11 Oct 2009 23:36:52 +0200, Stefan Miklosovic wrote: > hi list, > > if error output of some program appear on screen, > it is possible to print it also to some file simultaneously ? > > e.g > if I "cat" file which do not exist, error is on screen, > I want to add that error to some file (errors.txt) See "man sh" (or "man bash" if you use it): The redirection could be this: $ cat nonexist.txt > error.txt 2>&1 The C shell has a different syntax: % cat nonexist.txt >& error.txt I hope that's what you have requested. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...