diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 363c8d605..e0d26ef01 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -15,6 +15,13 @@ EPICS Base 3.15.0.x releases are not intended for use in production systems.

Changes between 3.15.0.1 and 3.15.0.2

+

Added echo command to iocsh

+ +

The single argument string may contain escaped characters, which will be +translated to their raw form before being printed (enclose the string in quotes +to avoid double-translation). A newline is always appended to the output, and +output stream redirection is supported.

+

Added macro EPICS_UNUSED to compilerDependencies.h

To prevent the compiler from warning about a known-unused variable, mark it diff --git a/src/libCom/iocsh/libComRegister.c b/src/libCom/iocsh/libComRegister.c index b3f3b2f36..18f68cc9f 100644 --- a/src/libCom/iocsh/libComRegister.c +++ b/src/libCom/iocsh/libComRegister.c @@ -13,6 +13,7 @@ #define epicsExportSharedSymbols #include "iocsh.h" #include "epicsStdioRedirect.h" +#include "epicsString.h" #include "epicsTime.h" #include "epicsThread.h" #include "epicsMutex.h" @@ -50,6 +51,17 @@ static void dateCallFunc (const iocshArgBuf *args) date(args[0].sval); } +/* echo */ +static const iocshArg echoArg0 = { "string",iocshArgString}; +static const iocshArg * const echoArgs[1] = {&echoArg0}; +static const iocshFuncDef echoFuncDef = {"echo",1,echoArgs}; +static void echoCallFunc(const iocshArgBuf *args) +{ + char *str = args[0].sval; + + dbTranslateEscape(str, str); /* in-place is safe */ + printf("%s\n", str); +} /* chdir */ static const iocshArg chdirArg0 = { "directory name",iocshArgString}; @@ -348,6 +360,7 @@ static void installLastResortEventProviderCallFunc(const iocshArgBuf *args) void epicsShareAPI libComRegister(void) { iocshRegister(&dateFuncDef, dateCallFunc); + iocshRegister(&echoFuncDef, echoCallFunc); iocshRegister(&chdirFuncDef, chdirCallFunc); iocshRegister(&pwdFuncDef, pwdCallFunc);