[GRASS-dev] Re: [GRASS GIS] #81: scripts: "echo -n" not portable

Paul Kelly paul-grass at stjohnspoint.co.uk
Thu Mar 6 06:31:58 EST 2008


On Thu, 6 Mar 2008, GRASS GIS wrote:

> #81: scripts: "echo -n" not portable
> ----------------------+-----------------------------------------------------
>  Reporter:  hamish   |       Owner:  hamish
>      Type:  defect   |      Status:  assigned
>  Priority:  blocker  |   Milestone:  6.3.0
> Component:  default  |     Version:  svn-trunk
> Resolution:           |    Keywords:
> ----------------------+-----------------------------------------------------
> Comment (by kyngchaos):
>
> If using echo without -n doesn't work for some reason, I found
> that/bin/echo on OSX 10.5 DOES work, it's the shell version of echo on
> 10.5 that doesn't have -n.
>
> The echo man page suggests using printf to suppress the newline char, for
> portability.

Remember also we have $GISBASE/etc/echo, for cases where a cross-platform 
identically-behaved echo command is required. It accepts both -n to 
suppress a newline, and -e to echo to stderr rather than stdout.

Paul


More information about the grass-dev mailing list