Overview
| Artifact ID: | bcbe4f4ecbf0d03d186ef915adc32633699d2962 |
|---|---|
| Ticket: | 218253ffffffffffffffffffffffffffffffffff
comment sign (#) in switch body |
| User & Date: | nobody on 2000-10-26 00:55:04 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 2860 Bug Version: 8.1 SubmitDate: '1999-09-21' LastModified: '1999-09-28' Severity: MED Status: Closed Submitter: techsupp ChangedBy: hobbs OS: Solaris OSVersion: 2.6.1 Machine: Other FixedDate: '2000-10-25' ClosedDate: '1999-09-28' Name: William Yan Comments: To keep comment systax consistent, require user put curly braces "{...}" around the pattern or add backslash "\" right before hashmark "#" if he/she do want to treat the hashmark "#" as a pattern. ReproducibleScript: #!/bin/sh #Start Tclsh exec tclsh $0 $@ switch -regexp [lindex $argv 0] { # branch1: get input string "a" a {puts "input is a"} b {puts "input is b"} default {puts "input is neither a nor b"} } The above is the content of executable script file. Just run it in Unix shell. ObservedBehavior: The interprete look the first line in switch body # branch1: get input string "a" as a real branch although as my intent it was comment. And the interprete then reports error. DesiredBehavior: Add comments in switch body. This sort of comment placement is user error, as specifically stated in the switch man page. The man page has been further updated for 8.3b1 to include an example of proper comment placement. -- 09/28/1999 hobbs - foundin changed to: "obsolete: 8.1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to: "comment sign (#) in switch body"
- type changed to: "Bug"