diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index ea511d5e9..20c173e5a 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -20,6 +20,13 @@
-->
+
Echoless comments in iocsh
+
+The way comments are parsed by the iocsh interpreter has changed. The
+interpreter can be selectively disabled from echoing comments coming from
+a script by starting those lines with '#-' rather than just '#'.
+
+
Changes pulled from the 3.15 branch since 3.16.0.1
diff --git a/src/libCom/iocsh/iocsh.cpp b/src/libCom/iocsh/iocsh.cpp
index d8701532e..c5b629ba6 100644
--- a/src/libCom/iocsh/iocsh.cpp
+++ b/src/libCom/iocsh/iocsh.cpp
@@ -611,12 +611,13 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros)
/*
* Ignore comment lines other than to echo
- * them if they came from a script. This
- * avoids macLib errors from comments.
+ * them if they came from a script (disable echoing
+ * with '#-'). This avoids macLib errors from comments.
*/
if (c == '#') {
if ((prompt == NULL) && (commandLine == NULL))
- puts(raw);
+ if (raw[icin + 1] != '-')
+ puts(raw);
continue;
}
@@ -635,10 +636,12 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros)
}
/*
- * Echo non-empty lines read from a script
+ * Echo non-empty lines read from a script.
+ * Comments delineated with '#-' aren't echoed.
*/
if ((prompt == NULL) && *line && (commandLine == NULL))
- puts(line);
+ if ((c != '#') || (line[icin + 1] != '-'))
+ puts(line);
/*
* Ignore lines that became a comment or empty after macro expansion
diff --git a/src/template/base/top/exampleBoot/ioc/st.cmd@Common b/src/template/base/top/exampleBoot/ioc/st.cmd@Common
index a2d018e3a..b2dfb4ae4 100644
--- a/src/template/base/top/exampleBoot/ioc/st.cmd@Common
+++ b/src/template/base/top/exampleBoot/ioc/st.cmd@Common
@@ -1,7 +1,7 @@
#!../../bin/_ARCH_/_APPNAME_
-## You may have to change _APPNAME_ to something else
-## everywhere it appears in this file
+#- You may have to change _APPNAME_ to something else
+#- everywhere it appears in this file
< envPaths
@@ -16,10 +16,10 @@ dbLoadTemplate "db/user.substitutions"
dbLoadRecords "db/_APPNAME_Version.db", "user=_USER_"
dbLoadRecords "db/dbSubExample.db", "user=_USER_"
-## Set this to see messages from mySub
+#- Set this to see messages from mySub
#var mySubDebug 1
-## Run this to trace the stages of iocInit
+#- Run this to trace the stages of iocInit
#traceIocInit
cd "${TOP}/iocBoot/${IOC}"
diff --git a/src/template/base/top/exampleBoot/ioc/st.cmd@RTEMS b/src/template/base/top/exampleBoot/ioc/st.cmd@RTEMS
index cc96f84ab..87e9e3b13 100644
--- a/src/template/base/top/exampleBoot/ioc/st.cmd@RTEMS
+++ b/src/template/base/top/exampleBoot/ioc/st.cmd@RTEMS
@@ -1,7 +1,7 @@
-## Example RTEMS startup script
+#- Example RTEMS startup script
-## You may have to change _APPNAME_ to something else
-## everywhere it appears in this file
+#- You may have to change _APPNAME_ to something else
+#- everywhere it appears in this file
#< envPaths
@@ -14,10 +14,10 @@ dbLoadTemplate("db/user.substitutions")
dbLoadRecords("db/_APPNAME_Version.db", "user=_USER_")
dbLoadRecords("db/dbSubExample.db", "user=_USER_")
-## Set this to see messages from mySub
+#- Set this to see messages from mySub
#var mySubDebug 1
-## Run this to trace the stages of iocInit
+#- Run this to trace the stages of iocInit
#traceIocInit
iocInit
diff --git a/src/template/base/top/exampleBoot/ioc/st.cmd@vxWorks b/src/template/base/top/exampleBoot/ioc/st.cmd@vxWorks
index 44a9afc67..617ba6111 100644
--- a/src/template/base/top/exampleBoot/ioc/st.cmd@vxWorks
+++ b/src/template/base/top/exampleBoot/ioc/st.cmd@vxWorks
@@ -1,7 +1,7 @@
-## Example vxWorks startup file
+#- Example vxWorks startup file
-## The following is needed if your board support package doesn't at boot time
-## automatically cd to the directory containing its startup script
+#- The following is needed if your board support package doesn't at boot time
+#- automatically cd to the directory containing its startup script
#cd "_TOP_/iocBoot/_IOC_"
< cdCommands
@@ -9,8 +9,8 @@
cd topbin
-## You may have to change _APPNAME_ to something else
-## everywhere it appears in this file
+#- You may have to change _APPNAME_ to something else
+#- everywhere it appears in this file
ld 0,0, "_APPNAME_.munch"
## Register all support components
@@ -23,10 +23,10 @@ dbLoadTemplate "db/user.substitutions"
dbLoadRecords "db/_APPNAME_Version.db", "user=_USER_"
dbLoadRecords "db/dbSubExample.db", "user=_USER_"
-## Set this to see messages from mySub
+#- Set this to see messages from mySub
#mySubDebug = 1
-## Run this to trace the stages of iocInit
+#- Run this to trace the stages of iocInit
#traceIocInit
cd startup
diff --git a/src/template/base/top/exampleBoot/nfsCommands@RTEMS b/src/template/base/top/exampleBoot/nfsCommands@RTEMS
index 0ba95a6d0..18ae461fa 100644
--- a/src/template/base/top/exampleBoot/nfsCommands@RTEMS
+++ b/src/template/base/top/exampleBoot/nfsCommands@RTEMS
@@ -1,26 +1,26 @@
-#Instructions for creating and using a real nfsCommands file
-#
-# in order to use nfs do the following:
-# 1) Create hostAdd and nfsMount commands for each nfs server
-# 2) In each st.cmd file add the following two commands BEFORE any load commands
-# ../nfs.cmd
-# cd "
-#
-# The hostAdd command has the form:
-# hostAdd("","xxx.xxx.xxx.xxx")
-#
-# You can also mount subdirectories as follows:
-# nfsMount("", "/xxx/xxx/xxx", "/xxx")
-#
-# For example assume
-#
-# host is mercury with inet address 155.77.2.56
-# You want to mount the directory (which is a file system of mercury)
-# /home/mercury5/iocinfo
-# as
-# /iocinfo
-#
-# The commands would be
-#
-# hostAdd("mercury","155.77.2.56")
-# nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo")
+#- Instructions for creating and using a real nfsCommands file
+#-
+#- in order to use nfs do the following:
+#- 1) Create hostAdd and nfsMount commands for each nfs server
+#- 2) In each st.cmd file add the following two commands BEFORE any load commands
+#- ../nfs.cmd
+#- cd "
+#-
+#- The hostAdd command has the form:
+#- hostAdd("","xxx.xxx.xxx.xxx")
+#-
+#- You can also mount subdirectories as follows:
+#- nfsMount("", "/xxx/xxx/xxx", "/xxx")
+#-
+#- For example assume
+#-
+#- host is mercury with inet address 155.77.2.56
+#- You want to mount the directory (which is a file system of mercury)
+#- /home/mercury5/iocinfo
+#- as
+#- /iocinfo
+#-
+#- The commands would be
+#-
+#- hostAdd("mercury","155.77.2.56")
+#- nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo")
diff --git a/src/template/base/top/exampleBoot/nfsCommands@vxWorks b/src/template/base/top/exampleBoot/nfsCommands@vxWorks
index 7cb8232f0..eb302c569 100644
--- a/src/template/base/top/exampleBoot/nfsCommands@vxWorks
+++ b/src/template/base/top/exampleBoot/nfsCommands@vxWorks
@@ -1,29 +1,29 @@
-#Instructions for creating and using a real nfsCommands file
-#
-# in order to use nfs do the following:
-# 1) Create hostAdd and nfsMount commands for each nfs server
-# 2) In each st.cmd file add the following two commands BEFORE any load commands
-# ../nfs.cmd
-# cd "
-#
-# The hostAdd command has the form:
-# hostAdd("","xxx.xxx.xxx.xxx")
-#
-# The nfsMount command has the form:
-# nfsMount("", "/xxx/xxx/xxx", "/xxx")
-#
-# You can also mount subdirectories as follows:
-# nfsMountAll("")
-#
-# For example assume
-#
-# host is mercury with inet address 155.77.2.56
-# You want to mount the directory (which is a file system of mercury)
-# /home/mercury5/iocinfo
-# as
-# /iocinfo
-#
-# The commands would be
-#
-# hostAdd("mercury","155.77.2.56")
-# nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo")
+#- Instructions for creating and using a real nfsCommands file
+#-
+#- in order to use nfs do the following:
+#- 1) Create hostAdd and nfsMount commands for each nfs server
+#- 2) In each st.cmd file add the following two commands BEFORE any load commands
+#- ../nfs.cmd
+#- cd "
+#-
+#- The hostAdd command has the form:
+#- hostAdd("","xxx.xxx.xxx.xxx")
+#-
+#- The nfsMount command has the form:
+#- nfsMount("", "/xxx/xxx/xxx", "/xxx")
+#-
+#- You can also mount subdirectories as follows:
+#- nfsMountAll("")
+#-
+#- For example assume
+#-
+#- host is mercury with inet address 155.77.2.56
+#- You want to mount the directory (which is a file system of mercury)
+#- /home/mercury5/iocinfo
+#- as
+#- /iocinfo
+#-
+#- The commands would be
+#-
+#- hostAdd("mercury","155.77.2.56")
+#- nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo")
diff --git a/src/template/base/top/iocBoot/ioc/st.cmd@Common b/src/template/base/top/iocBoot/ioc/st.cmd@Common
index ba71fbf81..dd0811dfb 100644
--- a/src/template/base/top/iocBoot/ioc/st.cmd@Common
+++ b/src/template/base/top/iocBoot/ioc/st.cmd@Common
@@ -1,7 +1,7 @@
#!../../bin/_ARCH_/_APPNAME_
-## You may have to change _APPNAME_ to something else
-## everywhere it appears in this file
+#- You may have to change _APPNAME_ to something else
+#- everywhere it appears in this file
< envPaths
diff --git a/src/template/base/top/iocBoot/ioc/st.cmd@Cross b/src/template/base/top/iocBoot/ioc/st.cmd@Cross
index 59e94ea2d..f42a26c1b 100644
--- a/src/template/base/top/iocBoot/ioc/st.cmd@Cross
+++ b/src/template/base/top/iocBoot/ioc/st.cmd@Cross
@@ -1,7 +1,7 @@
#!../../bin/_ARCH_/_APPNAME_
-## You may have to change _APPNAME_ to something else
-## everywhere it appears in this file
+#- You may have to change _APPNAME_ to something else
+#- everywhere it appears in this file
#< envPaths
diff --git a/src/template/base/top/iocBoot/ioc/st.cmd@RTEMS b/src/template/base/top/iocBoot/ioc/st.cmd@RTEMS
index f7c3d164f..a7d08fbcf 100644
--- a/src/template/base/top/iocBoot/ioc/st.cmd@RTEMS
+++ b/src/template/base/top/iocBoot/ioc/st.cmd@RTEMS
@@ -1,7 +1,7 @@
-## Example RTEMS startup script
+#- Example RTEMS startup script
-## You may have to change _APPNAME_ to something else
-## everywhere it appears in this file
+#- You may have to change _APPNAME_ to something else
+#- everywhere it appears in this file
#< envPaths
diff --git a/src/template/base/top/iocBoot/ioc/st.cmd@vxWorks b/src/template/base/top/iocBoot/ioc/st.cmd@vxWorks
index 04db4150f..43287d68b 100644
--- a/src/template/base/top/iocBoot/ioc/st.cmd@vxWorks
+++ b/src/template/base/top/iocBoot/ioc/st.cmd@vxWorks
@@ -1,7 +1,7 @@
-## Example vxWorks startup file
+#- Example vxWorks startup file
-## The following is needed if your board support package doesn't at boot time
-## automatically cd to the directory containing its startup script
+#- The following is needed if your board support package doesn't at boot time
+#- automatically cd to the directory containing its startup script
#cd "_TOP_/iocBoot/_IOC_"
< cdCommands
diff --git a/src/template/base/top/iocBoot/nfsCommands@RTEMS b/src/template/base/top/iocBoot/nfsCommands@RTEMS
index 62221da7c..dd8811319 100644
--- a/src/template/base/top/iocBoot/nfsCommands@RTEMS
+++ b/src/template/base/top/iocBoot/nfsCommands@RTEMS
@@ -1,29 +1,29 @@
-#Instructions for creating and using a real nfsCommands file
-#
-# in order to use nfs do the following:
-# 1) Create hostAdd and nfsMount commands for each nfs server
-# 2) In each st.cmd file add the following two commands BEFORE any load commands
-# ../nfs.cmd
-# cd "
-#
-# The hostAdd command has the form:
-# hostAdd("","xxx.xxx.xxx.xxx")
-#
-# The vxWorks nfsMount command has the form:
-# nfsMount("")
-#
-# You can also mount subdirectories as follows:
-# nfsMount("", "/xxx/xxx/xxx", "/xxx")
-#
-# For example assume
-#
-# host is mercury with inet address 155.77.2.56
-# You want to mount the directory (which is a file system of mercury)
-# /home/mercury5/iocinfo
-# as
-# /iocinfo
-#
-# The commands would be
-#
-# hostAdd("mercury","155.77.2.56")
-# nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo")
+#- Instructions for creating and using a real nfsCommands file
+#-
+#- in order to use nfs do the following:
+#- 1) Create hostAdd and nfsMount commands for each nfs server
+#- 2) In each st.cmd file add the following two commands BEFORE any load commands
+#- ../nfs.cmd
+#- cd "
+#-
+#- The hostAdd command has the form:
+#- hostAdd("","xxx.xxx.xxx.xxx")
+#-
+#- The vxWorks nfsMount command has the form:
+#- nfsMount("")
+#-
+#- You can also mount subdirectories as follows:
+#- nfsMount("", "/xxx/xxx/xxx", "/xxx")
+#-
+#- For example assume
+#-
+#- host is mercury with inet address 155.77.2.56
+#- You want to mount the directory (which is a file system of mercury)
+#- /home/mercury5/iocinfo
+#- as
+#- /iocinfo
+#-
+#- The commands would be
+#-
+#- hostAdd("mercury","155.77.2.56")
+#- nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo")
diff --git a/src/template/base/top/iocBoot/nfsCommands@vxWorks b/src/template/base/top/iocBoot/nfsCommands@vxWorks
index 62221da7c..dd8811319 100644
--- a/src/template/base/top/iocBoot/nfsCommands@vxWorks
+++ b/src/template/base/top/iocBoot/nfsCommands@vxWorks
@@ -1,29 +1,29 @@
-#Instructions for creating and using a real nfsCommands file
-#
-# in order to use nfs do the following:
-# 1) Create hostAdd and nfsMount commands for each nfs server
-# 2) In each st.cmd file add the following two commands BEFORE any load commands
-# ../nfs.cmd
-# cd "
-#
-# The hostAdd command has the form:
-# hostAdd("","xxx.xxx.xxx.xxx")
-#
-# The vxWorks nfsMount command has the form:
-# nfsMount("")
-#
-# You can also mount subdirectories as follows:
-# nfsMount("", "/xxx/xxx/xxx", "/xxx")
-#
-# For example assume
-#
-# host is mercury with inet address 155.77.2.56
-# You want to mount the directory (which is a file system of mercury)
-# /home/mercury5/iocinfo
-# as
-# /iocinfo
-#
-# The commands would be
-#
-# hostAdd("mercury","155.77.2.56")
-# nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo")
+#- Instructions for creating and using a real nfsCommands file
+#-
+#- in order to use nfs do the following:
+#- 1) Create hostAdd and nfsMount commands for each nfs server
+#- 2) In each st.cmd file add the following two commands BEFORE any load commands
+#- ../nfs.cmd
+#- cd "
+#-
+#- The hostAdd command has the form:
+#- hostAdd("","xxx.xxx.xxx.xxx")
+#-
+#- The vxWorks nfsMount command has the form:
+#- nfsMount("")
+#-
+#- You can also mount subdirectories as follows:
+#- nfsMount("", "/xxx/xxx/xxx", "/xxx")
+#-
+#- For example assume
+#-
+#- host is mercury with inet address 155.77.2.56
+#- You want to mount the directory (which is a file system of mercury)
+#- /home/mercury5/iocinfo
+#- as
+#- /iocinfo
+#-
+#- The commands would be
+#-
+#- hostAdd("mercury","155.77.2.56")
+#- nfsMount("mercury","/home/mercury5/iocinfo","/iocinfo")