Anonymous | Login | 2024-04-25 11:50 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 | ||
0001046 | [1003.1(2013)/Issue7+TC1] Shell and Utilities | Objection | Error | 2016-04-23 16:09 | 2017-06-01 15:09 | ||
Reporter | rillig | View Status | public | ||||
Assigned To | |||||||
Priority | normal | Resolution | Withdrawn | ||||
Status | Closed | ||||||
Name | Roland Illig | ||||||
Organization | |||||||
User Reference | |||||||
Section | 2.10. Shell Grammar | ||||||
Page Number | unsure | ||||||
Line Number | unsure | ||||||
Interp Status | --- | ||||||
Final Accepted Text | |||||||
Summary | 0001046: Grammar production if_clause allows "if command then" | ||||||
Description |
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02 [^] According to that grammar, the following text is valid: if echo then echo yes else echo no fi This is because the ''if_clause'' refers to the ''compound_list'', which, in its simplest form, can be reduced to just a WORD token, using these productions: if_clause := "if" compound_list "then" compound_list "fi" compound_list := term term := and_or and_or := pipeline pipeline := pipe_sequence pipe_sequence := simple_command simple_command := cmd_name cmd_name := WORD All shells that I know interpret this differently, taking the ''then echo yes else echo no fi'' as arguments to the ''echo'' command. |
||||||
Desired Action |
Check whether the grammar in its current form really allows this interpretation. If it does, restrict the grammar to disallow this, since it creates ambiguous programs. |
||||||
Tags | No tags attached. | ||||||
Attached Files | |||||||
|
Relationships | |||||||
|
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |