1

Internet says that Mac OS X 10.8 has achieved certification to The Open Group UNIX® 03 standard and that it is a compliant system.

But a simple test with echo seems to indicate otherwise:

 a) The Base Specification states

  Implementations shall not support any options.

 and

  IEEE Std 1003.1-2001/Cor 1-2002, item XCU/TC1/D6/21 is applied, so that the echo utility can accommodate historical BSD behavior.


 b) The man page says states

SYNOPSIS
echo [-n] [string ...]

 and

STANDARDS
The echo utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002.


 c) The reality is that it supports options. At least e 

(user@avitus tmp)$ uname -a
Darwin avitus.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64
(user@avitus tmp)$ echo -e "test \tAm I SUS compliant?"
test    Am I SUS compliant?
(user@avitus tmp)$ echo "test \tAm I SUS compliant?"
test \tAm I SUS compliant?



So, the questions are:
1. Does this break compliance?
2. Is Mac OS X 10.8 really SUS compliant?
3. Does the part item XCU/TC1/D6/21 is applied, so that the echo utility can accommodate historical BSD behavior. have something to do? If so, where is that item explained? The Technical Corrigendum Number 1 for the Austin Group Specifications doesn't say much.
4. Am I missing something?

1 Answers1

6

OS X 10.8 is also listed as a UNIX 03 registered product in http://www.opengroup.org/openbrand/register/.

If you are using bash, it is not POSIX-compliant by default. echo doesn't support any options by default in sh though.

$ bash
$ builtin echo -e a; /bin/echo -e a
a
-e a
$ sh
$ builtin echo -e a; /bin/echo -e a
-e a
-e a
$ shopt -u xpg_echo
$ builtin echo -e a; /bin/echo -e a
a
-e a

OS X's sh is a version of bash with differences like:

  • POSIX mode is enabled
  • xpg_echo is enabled (echo doesn't support any options and interprets escape sequences)
  • sh -l doesn't read .bash_profile
  • FCEDIT defaults to ed instead of EDITOR or ed
Lri
  • 5,223