>>>>> Markus Neteler <[EMAIL PROTECTED]> writes:

[...]

 >> the extra char is due to the newline:

 >> $ echo "" | wc -c 1 $ echo -n "" | wc -c 0

 > ah, right.  Question: is "-n" portable? I darkly remember some issue.

        It's mandated by POSIX at least [1].  Besides, it's already used
        widely in the GRASS scripts:

grass $ grep -rF '[ -n ' scripts/
... numerous...
grass $ 

        One may also use [ x"$varn" != x ] instead, but I'd be against
        such a practice (unless for a good reason.)

[...]

[1] http://www.opengroup.org/onlinepubs/009695399/utilities/test.html

_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to