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

hamish_nospam@yahoo.com wrote (Mon, Feb 19 2007 05:44:39):

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

Soereng,

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.

Best,
Maciek

-------------------------------------------- Managed by Request Tracker

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