[GRASSLIST:8363] Re: Remote execution of grass53 commands
Glynn Clements
glynn at gclements.plus.com
Tue Sep 20 14:22:28 EDT 2005
Suprit Kumar wrote:
> The problem starts when I tried to remotely execute the commands from a
> script using ssh.
>
> Here is example of the script and output,
>
> -------------------------------------------------------
> #!/bin/bash
>
> #First I have to start a grass session on remote machine "chambal"
> ssh chambal grass53 /home/suprit/grass53/GrassData/globe/goa
> # Then next grass command as.
> g.region raster=goa_map_1 (# I tried "ssh chambal g.region raster=goa_map_1"
> too.)....
> ...........
> --------------------------------------------------------
> This gives out output as shown below, the shell prompt is not returned and the
> next command (g.region raster=goa_map_1) does not get executed at all.....
> When I kill the Grass session by ctr-c only then g.region gets executed giving
> obvious error "ERROR: GISBASE not set"
>
> ---output---
> Cleaning up temporary files.....$TERM
> Starting GRASS ...
> >tput: No value for $TERM and no -T specified (both -T i specified and
> $TERM=xterm here
>
> Welcome to GRASS 5.3.0 (15 May 2004)....
> This version running thru the Bash Shell (/bin/bash)
> Help is available with the command: g.manual
> See the licence terms with: g.version -c
> Start the graphical user interface with: tcltkgrass&
> When ready to quit enter: exit
> |
>
>
> Am I doing something horribly wrong or there is some settings to be changed?
> Any suggestions and help is welcome.
The grass53 script starts an interactive shell; it doesn't complete
until you exit the shell.
If you want to run a script within a GRASS session, try:
ssh chambal sh -c '"SHELL=/path/to/script grass53 /home/suprit/grass53/GrassData/globe/goa"'
Alternatively, your script will need to set up the necessary variables
(e.g. GISBASE, GISRC) itself before attempting to run GRASS commands.
For more information, read the grass53 script itself, as well as the
Init.sh script which it calls.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-user
mailing list