Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Oct 2000 08:46:35 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        Roger Merritt <mcrogerm@stjohn.ac.th>, freebsd-questions@FreeBSD.ORG
Subject:   Re: I/O redirection in tcsh
Message-ID:  <20001018084634.J272@fw.wintelcom.net>
In-Reply-To: <20001018134813.C302@gray.westgate.gr>; from keramida@ceid.upatras.gr on Wed, Oct 18, 2000 at 01:48:13PM %2B0300
References:  <3.0.6.32.20001018164207.007c6850@stjohn.stjohn.ac.th> <20001018134813.C302@gray.westgate.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
* Giorgos Keramidas <keramida@ceid.upatras.gr> [001018 03:48] wrote:
> On Wed, Oct 18, 2000 at 04:42:07PM +0700, Roger Merritt wrote:
> > I can't figure out from the man page how to redirect STDERR to STDIN so
> > error messages will be logged while I'm running a job in the background. In
> > bash I could just add '2>&1' in the command line, but tcsh calls that
> > 'ambiguous redirection' and refuses to run the command. I tried just '>&',
> > but that didn't work, either. What's the proper command?
> 
> tcsh (and csh, for that matter) is known for it's lack of
> file-descriptor manipulation in the prompt.  You can do limited stuff like:
> 
>     % ./program >& program.stderr.log &
> 
> which will redirect only stderr of ./program in program.stderr.log, but
> I don't know of a way to redirect file descriptor 2 to where 1 points at
> that point.
> 
> I tend to use too many times the following trick:
> 
>     % /bin/sh -c './program 2>&1 > error.log &'

Try this:

(myprog >& /dev/stdout) > outfile

-Alfred


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001018084634.J272>