[GRASS-dev] POSIX Shell vs. $(), local, and test

Markus Neteler neteler at osgeo.org
Sat Jan 26 08:42:05 EST 2008


Thanks, Ivan,

I have uploaded your patch to GRASS-addons.

Markus

On Jan 15, 2008 7:32 AM, Ivan Shmakov <ivan at theory.asu.ru> wrote:
>  >>> Take a look at the minor change for lib/insert_raster.sh as well
>  >>> (attached.)
>
>  >> Looks much more polished. But it looks like bash to me, right?  So
>  >> far we try to avoid bash-isms in GRASS for portability.  Or will it
>  >> run with ash, too?
>
>  > It seems that both `local' and `$(COMMAND)' are available in either
>  > `dash' or BusyBox' `ash', e. g.:
>
> [...]
>
>  > It's probably reasonable to require a Shell implementation with
>  > either once you're depending on Shell functions being available.
>
>  > I'm not sure that these constructs are mandated by any standard,
>  > though.
>
>         Apparently, the $(COMMAND) substitution is mandated by IEEE Std
>         1003.1 (AKA POSIX) [1].  On the contrary, the `local' keyword
>         isn't available as per [2].
>
>  > The `test' (`[ ... ]') command should be generally available as well.
>  > IIRC, it's mandated by POSIX.
>
>         The `test X -lt Y' form is also available [3].
>
>         Hence, I suggest the attached patch instead of the former one.
>
> [...]
>
> [1] http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03
> [2] http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.htm
> [3] http://www.opengroup.org/onlinepubs/009695399/utilities/test.html


More information about the grass-dev mailing list