[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trouble with redirecting gs output in make
From: |
Paul D. Smith |
Subject: |
Re: Trouble with redirecting gs output in make |
Date: |
Mon, 13 Jan 2003 14:32:42 -0500 |
%% "TAZ Vukovic, Mirko" <address@hidden> writes:
tvm> I am having trouble with the following command in GNUmake 3.79.1,
tvm> where I am trying to capture the bounding box info in a file:
tvm> $(GS) -dNOPAUSE -sDEVICE=bbox -dBATCH $(<) >& $(@)
tvm> It produces the error
tvm> Syntax error: Bad fd number
The operator ">&" is a C shell operator (and some Bourne-alike shells,
like bash, also implement it).
All versions of make, including GNU make, invoke their commands using
the Bourne shell /bin/sh, not csh, so this operator is invalid in make
commands, thus your error.
The right way to redirect both stdout and stderr in sh is:
> $@ 2>&1
(specifically, redirect stdout to $@, then dup stderr to go to the same
place as stdout).
HTH.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist