[GRASSLIST:4183] Re: redirecting v.what results to file using batch-grass

Roger Bivand Roger.Bivand at nhh.no
Wed Jul 31 05:05:14 EDT 2002


On Wed, 31 Jul 2002, Glynn Clements wrote:

> 
> Andrew wrote:
> 
> > I've managed to get the v.what command to redirect it's results to file
> > (using >) but I'm having some problems doing this when using
> > batch-grass.sh.  I always get the same error message:
> > 
> > Sorry <>> is not a valid option
> > Sorry <v.whatoutput> is not a valid option
> > 
> > and I get the same if using | instead of > (1st error message obviously
> > changes the invalid sign)
> > 
> > My full batch-grass line is (in Pascal)
> > 
> > Exec('batch-grass.sh stellenbosch andrew v.what map=stbstreets_wgs84
> > east_north=18.830,-33.935 > v.whatoutput','');
> 
> and:
> 
> > Sorry, I forgot to specify that the result is redirected to file if
> > batch-grass.sh is run on the command line, but I get the errors when
> > batch-grass is run from another programme (Pascal).
> > By the way, batch-grass works fine using Exec in Pascal, the errors are
> > generated when I try redirect the result to file using batch-grass.
> 
> This appears to be an issue with the way that the Exec() function
> works.
> 
> The redirection operators are implemented by the shell. Presumably
> Exec() doesn't use the shell, in which case you won't be able to use
> any shell constructs in the command.
> 

Maybe then put a /bin/sh in front of the batch-grass.sh, and or make a 
local copy of batch-grass.sh inside a wrapper doing the redirection?

Roger

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no
and: Department of Geography and Regional Development, University of
Gdansk, al. Mar. J. Pilsudskiego 46, PL-81 378 Gdynia, Poland.



More information about the grass-user mailing list