iocsh ignores inline-comment
Bug #1932153 reported by
Niko Kivel
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Opinion
|
Wishlist
|
Unassigned |
Bug Description
A function call in iocsh, followed by a comment does not work as expected.
observed behaviour:
```
epicsEnvSet("VAR", "0") # set VAR to a very important value. For VAR>42 blah blah
```
is creating an empty file named `42` in $PWD.
expected behaviour:
All characters after the '#' character should be treated as comment.
test versions:
3.14.12 and 7.0.5
summary: |
- iocsh ignores comment + iocsh ignores inline-comment |
To post a comment you must log in.
Unfortunately inline comments like that have never been supported by iocsh. '#' is just treated as another command which does nothing. Comments are documented in /epics. anl.gov/ base/R3- 15/6-docs/ AppDevGuide/ IOCShell. html#x19- 74000018. 2.5
https:/
although that doesn't really clarify that inline comments are not supported.
Given the rather complicated way that iocsh processes each command line I don't know how easy it would be to actually implement such inline comments. If you were to work on a patch to implement this, please check that other commands can still accept # characters inside string parameters – there may be a fundamental problem there given that parameters don't have to be enclosed inside quotes, this iocsh command shows the problem:
epics> echo ###-Hello-###
###-Hello-###