iocsh ignores inline-comment

Bug #1932153 reported by Niko Kivel
6
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

Niko Kivel (niko-kivel)
summary: - iocsh ignores comment
+ iocsh ignores inline-comment
Revision history for this message
Andrew Johnson (anj) wrote :

Unfortunately inline comments like that have never been supported by iocsh. '#' is just treated as another command which does nothing. Comments are documented in
 https://epics.anl.gov/base/R3-15/6-docs/AppDevGuide/IOCShell.html#x19-74000018.2.5
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-###

Changed in epics-base:
importance: Undecided → Wishlist
status: New → Opinion
Revision history for this message
Niko Kivel (niko-kivel) wrote :

Thanks Andrew for looking at this.
I understand the situation. I'm not going to work on a patch for this.
I'd rather move to something that creates the iocsh-scripts for me from a template, like jinja2.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.