[GRASS-dev] g.mlist as C implementation?

Maciej Sieczka tutey at o2.pl
Tue Sep 11 12:36:09 EDT 2007


Glynn Clements wrote:
> Hamish wrote:

>> I noticed parts of the script may be a bit fragile/inefficient, which is
>> of concern for a module mainly intended as a scripting tool.
>>
>> - The script relies on "echo -n"; not portable?

> Nope. According to the official specification, echo doesn't accept any
> switches. OTOH, the GNU version doesn't support the \c sequence. IOW,
> there is no portable way to echo a string without appending a newline.

We can use printf instead I guess. By default it does not append a
newline (to append it, add \n at the end of the string to be printed).

It seems to be portable and POSIX compliant, see eg. [1].

[1]http://pwet.fr/man/linux/commandes/posix/echo

Maciek




More information about the grass-dev mailing list