[GRASS-dev] [bug #5499] (grass) bash scripts starting with #!/bin/sh

Hamish hamish_nospam at yahoo.com
Tue Feb 20 18:00:34 EST 2007


Hamish:
> > Everyone can play along at home by changing the first line of the
> > script to "#!/bin/ash -x" and follow the output trail.

Maciek:
> Do you think you could add a test for BASHisms in GRASS scripts, by
> forcing them to use eg. dash in your testsuite (link /bin/sh to your
> dash executable, instead of bash)? That would let us spot all eventual
> problems at one attempt.


easier:

for CMD in `\ls -1 "$GISBASE"/scripts/?\.*` ; do
  ash -n "$CMD"
done

/usr/local/src/grass/grass63/dist.i686-pc-linux-gnu/scripts/i.spectral:
252: Syntax error: Bad substitution
/usr/local/src/grass/grass63/dist.i686-pc-linux-gnu/scripts/r.tileset:
258: Syntax error: Bad for loop variable


So i.spectral includes a Bashism too. It is limited to the COORD[]
array, so probably not too hard for someone to fix that.

r.tileset covered in another email to follow.


Hamish




More information about the grass-dev mailing list