Apologies for the total beginner's question, but despite my efforts
and searches through the GRASS mailing list archives I have not been
able to solve my problem. I am trying to write a simple grass script
in order to automated a process, but I have not very far yet. One
thing that I would like to do is to be able to change the region, but
GRASS seems to come up with the whenever I , for example, try to use
the following simple lines:
#!/bin/sh
g.region rast=map1
r.stats -ln map1 > file1
The message I get is: "command not found". What am I doing wrong? Is
this problem related to the setting of environment variables?
Il giorno gio, 04/12/2008 alle 17.06 +0000, Mario Giacomello ha scritto:
Dear all,
Apologies for the total beginner's question, but despite my efforts
and searches through the GRASS mailing list archives I have not been
able to solve my problem. I am trying to write a simple grass script
in order to automated a process, but I have not very far yet. One
thing that I would like to do is to be able to change the region, but
GRASS seems to come up with the whenever I , for example, try to use
the following simple lines:
#!/bin/sh
g.region rast=map1
r.stats -ln map1 > file1
The message I get is: "command not found". What am I doing wrong? Is
this problem related to the setting of environment variables?
Ivan Marchesini
Department of Civil and Environmental Engineering
University of Perugia
Via G. Duranti 93/a
06125
Perugia (Italy)
Socio fondatore GFOSS "Geospatial Free and Open Source Software" http://www.gfoss.it
e-mail: marchesini@unipg.it
ivan.marchesini@gmail.com
tel: +39(0)755853760
fax (university): +39(0)755853756
fax (home): +39(0)5782830887
jabber: geoivan73@jabber.org
Thanks for your prompt response. I have got as far as understanding
that I should run scripts inside GRASS.So, the answer is "yes- I have
run the script inside GRASS".
Marco
On Thu, Dec 4, 2008 at 5:54 PM, ivan marchesini <marchesini@unipg.it> wrote:
hmmm
are you starting the script inside grass?
probably not... or I'm wrong?
Ivan
Il giorno gio, 04/12/2008 alle 17.06 +0000, Mario Giacomello ha scritto:
Dear all,
Apologies for the total beginner's question, but despite my efforts
and searches through the GRASS mailing list archives I have not been
able to solve my problem. I am trying to write a simple grass script
in order to automated a process, but I have not very far yet. One
thing that I would like to do is to be able to change the region, but
GRASS seems to come up with the whenever I , for example, try to use
the following simple lines:
#!/bin/sh
g.region rast=map1
r.stats -ln map1 > file1
The message I get is: "command not found". What am I doing wrong? Is
this problem related to the setting of environment variables?
Ivan Marchesini
Department of Civil and Environmental Engineering
University of Perugia
Via G. Duranti 93/a
06125
Perugia (Italy)
Socio fondatore GFOSS "Geospatial Free and Open Source Software" http://www.gfoss.it
e-mail: marchesini@unipg.it
ivan.marchesini@gmail.com
tel: +39(0)755853760
fax (university): +39(0)755853756
fax (home): +39(0)5782830887
jabber: geoivan73@jabber.org
On Thu, 4 Dec 2008 17:46:36 +0000
"Mario Giacomello" <mario.giacomello@googlemail.com> wrote:
Thanks for your prompt response. I have got as far as understanding
that I should run scripts inside GRASS.So, the answer is "yes- I have
run the script inside GRASS".
try to start the script with:
sh grassscript.sh
or
./grassscript.sh (if you made it executable)
regards,
Otto
Marco
On Thu, Dec 4, 2008 at 5:54 PM, ivan marchesini <marchesini@unipg.it> wrote:
> hmmm
> are you starting the script inside grass?
>
> probably not... or I'm wrong?
>
> Ivan
>
> Il giorno gio, 04/12/2008 alle 17.06 +0000, Mario Giacomello ha scritto:
>> Dear all,
>>
>> Apologies for the total beginner's question, but despite my efforts
>> and searches through the GRASS mailing list archives I have not been
>> able to solve my problem. I am trying to write a simple grass script
>> in order to automated a process, but I have not very far yet. One
>> thing that I would like to do is to be able to change the region, but
>> GRASS seems to come up with the whenever I , for example, try to use
>> the following simple lines:
>>
>> #!/bin/sh
>>
>> g.region rast=map1
>> r.stats -ln map1 > file1
>>
>> The message I get is: "command not found". What am I doing wrong? Is
>> this problem related to the setting of environment variables?
>>
>> I am using GRASS 6.3.0 installed on Ubuntu 8.10
>>
>> thanks in advance,
>>
>> Mario Giacomello
On Thu, 4 Dec 2008 17:46:36 +0000
"Mario Giacomello" <mario.giacomello@googlemail.com> wrote:
> Thanks for your prompt response. I have got as far as understanding
> that I should run scripts inside GRASS.So, the answer is "yes- I have
> run the script inside GRASS".
try to start the script with:
sh grassscript.sh
or
./grassscript.sh (if you made it executable)
regards,
Otto
> Marco
>
> On Thu, Dec 4, 2008 at 5:54 PM, ivan marchesini <marchesini@unipg.it> wrote:
> > hmmm
> > are you starting the script inside grass?
> >
> > probably not... or I'm wrong?
> >
> > Ivan
> >
> > Il giorno gio, 04/12/2008 alle 17.06 +0000, Mario Giacomello ha scritto:
> >> Dear all,
> >>
> >> Apologies for the total beginner's question, but despite my efforts
> >> and searches through the GRASS mailing list archives I have not been
> >> able to solve my problem. I am trying to write a simple grass script
> >> in order to automated a process, but I have not very far yet. One
> >> thing that I would like to do is to be able to change the region, but
> >> GRASS seems to come up with the whenever I , for example, try to use
> >> the following simple lines:
> >>
> >> #!/bin/sh
> >>
> >> g.region rast=map1
> >> r.stats -ln map1 > file1
> >>
> >> The message I get is: "command not found". What am I doing wrong? Is
> >> this problem related to the setting of environment variables?
> >>
> >> I am using GRASS 6.3.0 installed on Ubuntu 8.10
> >>
> >> thanks in advance,
> >>
> >> Mario Giacomello
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
On Thu, Dec 4, 2008 at 6:46 PM, Mario Giacomello
<mario.giacomello@googlemail.com> wrote:
Thanks for your prompt response. I have got as far as understanding
that I should run scripts inside GRASS.So, the answer is "yes- I have
run the script inside GRASS".
best is to add this before the GRASS commands in the
script:
if [ -z "$GISBASE" ] ; then
echo "You must be in GRASS GIS to run this program." >&2
exit 1
fi