[GRASS-user] shell script stopped worlking

Hamish hamish_nospam at yahoo.com
Wed Mar 21 18:35:56 EDT 2007


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




More information about the grass-user mailing list