[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Failed make doc for Patchy

From: Graham Percival
Subject: Re: Failed make doc for Patchy
Date: Wed, 14 Mar 2012 21:36:07 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Mar 14, 2012 at 10:27:52PM +0100, David Kastrup wrote:
> And the MacOSX /bin/sh is the first shell I heard of that does not grok
> echo -n.

>      If this may not be true, `printf' is in general safer and easier
>      to use than `echo' and `echo -n'.

This matches the open group specifications.


    It is not possible to use echo portably across all POSIX
systems unless both -n (as the first argument) and escape
sequences are omitted.

    The printf utility can be used portably to emulate any of the
traditional behaviors of the echo utility as follows (assuming
that IFS has its standard value or is unset):

        The historic System V echo and the requirements on XSI
implementations in this volume of IEEE Std 1003.1-2001 are
equivalent to:

        printf "%b\n" "$*"

        The BSD echo is equivalent to:

        if [ "X$1" = "X-n" ]
            printf "%s" "$*"
            printf "%s\n" "$*"

    New applications are encouraged to use printf instead of echo.

- Graham

reply via email to

[Prev in Thread] Current Thread [Next in Thread]