[GRASS-user] shell script stopped worlking

Heloo all.

my r.roughness script was working fine, but today I tried to use it
and get this:

(BTW, GRASS 6.3-cvs, Ubuntu Linux 6.10)

: 221: ==: unexpected operator

GRASS_INFO_MESSAGE(2621,1): Scanning input for column types ...

GRASS_INFO_MESSAGE(2621,2): Maximum input row length: 0

GRASS_INFO_MESSAGE(2621,3): Maximum number of columns: 0

GRASS_INFO_MESSAGE(2621,4): Minimum number of columns: -1

GRASS_INFO_ERROR(2621,5): x column number > minimum last column number
GRASS_INFO_ERROR(2621,5): (incorrect field separator?)

Does this have something to do with the recent changes in parser?

The script is attached

--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Geologist M.Sc - Doctorate Student at IGc-USP - Brazil
Linux User #89721 - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke

(attachments)

r.roughness (6.49 KB)

Carlos wrote:

my r.roughness script was working fine, but today I tried to use it
and get this:

(BTW, GRASS 6.3-cvs, Ubuntu Linux 6.10)

: 221: ==: unexpected operator

..

Does this have something to do with the recent changes in parser?

No, changes in Ubuntu. Now it uses [d]ash as the default /bin/sh, not
Bash, and your script uses Bash specific tricks:

    east=$(echo "scale=6; $west + $grid" | bc);

either make those sh compatible,

    east="`echo "scale=6; $west + $grid" | bc`"

or change the shebang to #!/bin/bash

Hamish

Thanks Hamish!

On 3/21/07, Hamish <hamish_nospam@yahoo.com> wrote:

Carlos wrote:
> my r.roughness script was working fine, but today I tried to use it
> and get this:
>
> (BTW, GRASS 6.3-cvs, Ubuntu Linux 6.10)
>
> : 221: ==: unexpected operator
..
> Does this have something to do with the recent changes in parser?

No, changes in Ubuntu. Now it uses [d]ash as the default /bin/sh, not
Bash, and your script uses Bash specific tricks:

    east=$(echo "scale=6; $west + $grid" | bc);

either make those sh compatible,

    east="`echo "scale=6; $west + $grid" | bc`"

or change the shebang to #!/bin/bash

Hamish

--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Geologist M.Sc - Doctorate Student at IGc-USP - Brazil
Linux User #89721 - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke