diff --git a/src/iocsh/iocsh.cpp b/src/iocsh/iocsh.cpp index bfdaa4565..41675f4aa 100644 --- a/src/iocsh/iocsh.cpp +++ b/src/iocsh/iocsh.cpp @@ -331,12 +331,6 @@ iocsh (const char *pathname) if (*raw == '#') continue; - /* - * Echo commands read from scripts - */ - if ((prompt == NULL) && *raw) - puts(raw); - /* * Expand macros */ @@ -344,6 +338,12 @@ iocsh (const char *pathname) if ((line = macEnvExpand(raw)) == NULL) continue; + /* + * Echo commands read from scripts + */ + if ((prompt == NULL) && *line) + puts(line); + /* * Break line into words */