NetBSD-Bugs archive

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

bin/47795: ksh(1): unset(1)ting a readonly variable stops evaluation of startup script



>Number:         47795
>Category:       bin
>Synopsis:       ksh(1): unset(1)ting a readonly variable stops evaluation of 
>startup script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 04 13:05:00 +0000 2013
>Originator:     Steffen
>Release:        NetBSD 6.99.19 (GENERIC) #0: Sun Apr 28 17:23:09 UTC 2013
>Organization:
>Environment:
>Description:
>>>
      # Determine shell type; aux while there
      echo BEFORE
      unset KSH_VERSION
      echo AFTER
      case ${0} in
===
NetBSD 6.99.19 (GENERIC) #0: Sun Apr 28 17:23:09 UTC 2013

Welcome to NetBSD!
[.]
Thank you for helping us test and improve NetBSD.

BEFORE
ksh: /home/steffen/.shrc[125]: unset: KSH_VERSION is read only
<<<

This is an interactive shell, and POSIX says
(XCU, chapter 2: Shell Command Language):

  2.8.1 Consequences of Shell Errors
  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.

The shell doesn't exit, but it stops evaluation of the startup
file(s) instead of simply printing the error and setting $? to 1.
I think this behaviour is wrong.
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index