Thorsten Glaser <[email protected]> wrote:
 |Steffen Daode Nurpmeso dixit:
 |
 |…
 |Well, don’t do that then.

That is indeed the point at which i'm guilty.

 |tg@blau:~ $ mksh -c 'unset KSH_VERSION'
 |mksh: read-only: KSH_VERSION
 |
 |>I'd consider this a bug, since POSIX says „Read-only variables
 |>cannot be unset“ but i fail to see why this should result in
 |>anything more than $? being 1, especially without set -e?
 |
 |unset is a POSIX special built-in utility. It says:

 |    EXIT STATUS
 |
 |    0
 |          All name operands were successfully unset.
 |>0
 |          At least one name could not be unset.
 |
 |    CONSEQUENCES OF ERRORS
 |
 |     Default.
 […]
 |
 |There are even checks in the testsuite for that, so you’d probably
 |better accept this and move on and just Don’t Do That Then ;-)

hmhmm, 2.8.1 says indeed ,)

  For a non-interactive shell, an error condition encountered by
  a special built-in (see Special Built-In Utilities) or other
  type of utility shall cause the shell to write a diagnostic
  message to standard error and exit as shown in the following
  table:
  […]
  In all of the cases shown in the table, an interactive shell shall
  write a diagnostic message to standard error without exiting.

 |bye,
 |//mirabilos
 |-- 
 |“It is inappropriate to require that a time represented as
 | seconds since the Epoch precisely represent the number of
 | seconds between the referenced time and the Epoch.”
 |      -- IEEE Std 1003.1b-1993 (POSIX) Section B.2.2.2

But clarification by POSIX is possibly undesirable :)
I'll keep on hanging around sofar, ciao,

--steffen

Reply via email to