Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Oct 2000 13:48:13 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Roger Merritt <mcrogerm@stjohn.ac.th>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: I/O redirection in tcsh
Message-ID:  <20001018134813.C302@gray.westgate.gr>
In-Reply-To: <3.0.6.32.20001018164207.007c6850@stjohn.stjohn.ac.th>; from mcrogerm@stjohn.ac.th on Wed, Oct 18, 2000 at 04:42:07PM %2B0700
References:  <3.0.6.32.20001018164207.007c6850@stjohn.stjohn.ac.th>

next in thread | previous in thread | raw e-mail | index | archive | help
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 &'

Ciao,
Giorgos.


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?20001018134813.C302>