| Anonymous | Login | Signup for a new account | 2010-09-03 08:53 UTC |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
| ID | Category | Severity | Type | Date Submitted | Last Update | |||||||
| 0000155 | [1003.1(2008)/Issue 7] Shell and Utilities | Objection | Error | 2009-09-22 11:24 | 2009-12-07 16:55 | |||||||
| Reporter | geoffclare | View Status | public | |||||||||
| Assigned To | ajosey | |||||||||||
| Priority | normal | Resolution | Accepted | |||||||||
| Status | Interpretation Required | |||||||||||
| Name | Geoff Clare | |||||||||||
| Organization | The Open Group | |||||||||||
| User Reference | ||||||||||||
| Section | 2.14 set | |||||||||||
| Page Number | 2359 | |||||||||||
| Line Number | 74590 | |||||||||||
| Interp Status | Approved | |||||||||||
| Final Accepted Text | Note: 0000290 | |||||||||||
| Summary | 0000155: set -u should require an error when $1 etc. are unset | |||||||||||
| Description |
A discussion on the austin-group-l mailing list in May 2009 identified a problem with the description of set -u. Since it uses the word "variable" instead of "parameter", the shell is not required to report an error if the positional parameters $1, $2, etc. are used when unset. This does not match existing practice. The question then arose of how to correct the problem, particularly the detail of whether set -u should apply to $@ and $*. It was felt that it should not apply to these, even though some shells do currently report an error for them, since it is normal and common for $@ and $* to be used in shell scripts regardless of whether they were passed any arguments. |
|||||||||||
| Desired Action |
Change: "The shell shall write a message to standard error when it tries to expand a variable that is not set and immediately exit." to: "The shell shall write a message to standard error and immediately exit when it tries to expand an unset parameter other than the '@' and '*' special parameters." Add to RATIONALE for set after line 74714: "Historically some shells applied the -u option to all parameters including $@ and $*. The standard developers felt that this was a misfeature since it is normal and common for $@ and $* to be used in shell scripts regardless of whether they were passed any arguments. Treating these uses as an error when no arguments are passed reduces the value of -u for its intended purpose of finding spelling mistakes in variable names and uses of unset positional parameters." |
|||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
|
|
||||||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2009-09-22 11:24 | geoffclare | New Issue | |
| 2009-09-22 11:24 | geoffclare | Status | New => Under Review |
| 2009-09-22 11:24 | geoffclare | Assigned To | => ajosey |
| 2009-09-22 11:24 | geoffclare | Name | => Geoff Clare |
| 2009-09-22 11:24 | geoffclare | Organization | => The Open Group |
| 2009-09-22 11:24 | geoffclare | Section | => 2.14 set |
| 2009-09-22 11:24 | geoffclare | Page Number | => 2359 |
| 2009-09-22 11:24 | geoffclare | Line Number | => 74590 |
| 2009-09-22 11:24 | geoffclare | Interp Status | => --- |
| 2009-09-24 15:57 | msbrown | Interp Status | --- => Pending |
| 2009-09-24 15:57 | msbrown | Note Added: 0000240 | |
| 2009-09-24 15:57 | msbrown | Status | Under Review => Interpretation Required |
| 2009-09-24 15:57 | msbrown | Resolution | Open => Accepted |
| 2009-11-07 07:27 | ajosey | Note Added: 0000290 | |
| 2009-11-07 07:28 | ajosey | Interp Status | Pending => Proposed |
| 2009-11-07 07:28 | ajosey | Final Accepted Text | => Note: 0000290 |
| 2009-11-07 07:28 | ajosey | Note Edited: 0000290 | |
| 2009-11-07 07:28 | ajosey | Note Edited: 0000290 | |
| 2009-12-07 16:55 | ajosey | Interp Status | Proposed => Approved |
| Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |