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

Maciek Sieczka via RT grass-bugs at intevation.de
Sun Feb 18 18:30:48 EST 2007


guest wrote (Sun, Feb 18 2007 16:47:52):

> I experienced problems with Ubuntu 6.10 installation. The r.in.wms script
> refused to work with errors like this:
> /usr/lib/grass/etc/r.in.wms//wms.request: 326: SIZE_ARRAY[0]=: not found
> /usr/lib/grass/scripts/r.tileset: 193: declare: not found
> /usr/lib/grass/scripts/r.tileset: 258: Syntax error: Bad for loop variable
> 
> It took me about a couple of hours to find out that the reason is that
> Ubuntu developers decided to change the symbolic link /bin/sh from /bin/bash
> to /bin/dash, which is POSIX-compliant, but much less feature-rich than
> bash.
> 
> Setting it back to /bin/bash solved the problem, but still indicating the
> right interpreter in the headers will also be great.

Hi,

Thanks for the report and the hint of what is going on. Well spotted.

However, please don't report to this tracker in future - read the
http://grass.itc.it/bugtracking/index.php. We are working on disabling the old
RT for good.

Since the issue has been reported twice to RT anyway, I'll let myself to
continue here, especially that it seems big.

AFAIK, GRASS shell scripts are supposed to work with any POSIX 1003.2
compliant sh interpreter. Apparently some still don't, eg. r.tileset and
r.in.wms as we can see.

As the bash->dash switch in Ubuntu 6.1 seems inrevertable (see:
https://launchpad.net/ubuntu/+source/dash/+bug/61463, the comment by Matthew
Garrett at 2006-11-29 05:23:16 UTC, in particular), and it looks justified
from technical point of view, we have 3 options it seems:

1. Have (some) GRASS sh scripts broken for Ubuntu (what if other distros
follow Ubuntu?). What with platforms not providing bash?

2. Revise all the scripts and fix all bashisms; buts:
- who would do it?
- it takes quite some knowledge to decide what needs to be fixed, and it could
take much time
- what with the addons? remove all that are not POSIX-compliant? fix them
ourselves? Anyway, much work.

3. Change all GRASS sh scripts to require #/bin/bash. Least work. But what
with platforms not providing bash?

Maciek


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




More information about the grass-dev mailing list