From owner-freebsd-questions@FreeBSD.ORG Sat Dec 22 07:51:53 2007 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 5BD6516A41B for ; Sat, 22 Dec 2007 07:51:53 +0000 (UTC) (envelope-from liettneff@bk.ru) Received: from cny.innet.yaroslavl.su (cny.innet.yaroslavl.su [217.15.134.68]) by mx1.freebsd.org (Postfix) with ESMTP id 87DF713C455 for ; Sat, 22 Dec 2007 07:51:52 +0000 (UTC) (envelope-from liettneff@bk.ru) Received: from tac.innet.yaroslavl.su (tac.innet.yaroslavl.su [217.15.135.68]) by cny.innet.yaroslavl.su (8.11.6/8.11.6) with ESMTP id lBM7pha97194; Sat, 22 Dec 2007 10:51:44 +0300 (MSK) Received: from reaper.yaroslavl.ru (reaper.yaroslavl.ru [85.113.202.195]) by tac.innet.yaroslavl.su (8.13.7/8.13.7) with ESMTP id lBM7phxj018217; Sat, 22 Dec 2007 10:51:43 +0300 (MSK) Received: from comp-reaper (comp-reaper [10.19.1.3]) by reaper.yaroslavl.ru (Postfix) with ESMTP id E25FE22848; Sat, 22 Dec 2007 10:51:40 +0300 (MSK) Date: Sat, 22 Dec 2007 10:52:04 +0300 From: Michael Lednev X-Mailer: The Bat! (v3.99.29) Professional Organization: none X-Priority: 3 (Normal) Message-ID: <964986422.20071222105204@bk.ru> To: jhall@vandaliamo.net In-Reply-To: <49457.65.117.48.155.1198258492.squirrel@admintool.trueband.net> References: <51935.12.170.206.13.1198248568.squirrel@admintool.trueband.net> <1044977630.20071221175247@bk.ru> <49254.65.117.48.155.1198256367.squirrel@admintool.trueband.net> <863400045.20071221201413@bk.ru> <49457.65.117.48.155.1198258492.squirrel@admintool.trueband.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Redirecting STDOUT X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Michael Lednev List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2007 07:51:53 -0000 Hello, jhall. On 21 ??????? 2007 ?., 20:34:52 you wrote: jvn> When I run this as a non-root user it works fine. But, when running it as jvn> root, it does not produce the expected results. jvn> $ ls -l /fjdkslafjdl 2>/home/hallja/test2 jvn> And, in the file test2, I see jvn> ls: /fjdkslafjdl: No such file or directory jvn> Running the same command as root, I receive the following results. jvn> # ls -l /fjdkslafjdl 2>/home/hallja/test2 jvn> ls: /fjdkslafjdl: No such file or directory jvn> And, in /home/hallja/test2 I see the following. jvn> -rw-r--r-- 1 root hallja 0 Dec 21 08:02 2 jvn> Why does this not work as root? Because default shell for root is csh. Try this # command >& file this will redirect both STDERR and STDOUT to file -- Best regards, Michael mailto:liettneff@bk.ru