[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.
http://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html
...
APPLICATION USAGE
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" ]
then
shift
printf "%s" "$*"
else
printf "%s\n" "$*"
fi
New applications are encouraged to use printf instead of echo.
- Graham
- Re: Failed make doc for Patchy, (continued)
- Re: Failed make doc for Patchy, Phil Holmes, 2012/03/14
- Re: Failed make doc for Patchy, David Kastrup, 2012/03/14
- Re: Failed make doc for Patchy, David Kastrup, 2012/03/14
- Re: Failed make doc for Patchy, James, 2012/03/14
- Re: Failed make doc for Patchy, David Kastrup, 2012/03/14
- Re: Failed make doc for Patchy, David Kastrup, 2012/03/14
- Re: Failed make doc for Patchy, Carl Sorensen, 2012/03/14
- Re: Failed make doc for Patchy, David Kastrup, 2012/03/14
- Re: Failed make doc for Patchy,
Graham Percival <=
- Re: Failed make doc for Patchy, David Kastrup, 2012/03/14