It's all about the answers!

Ask a question

"echo on" doesn't work


Tim McDaniel (401146) | asked Jul 02 '10, 4:05 p.m.
When a Build Forge agent is running under Windows, "echo on" is the
default value but it does not appear to have any effect. Any idea why
not? One thought I had was that Build Forge was stripping everything
that looked like a command echo, but that appears not to be the case.

--
Tim McDaniel, tmcd@panix.com

One answer



permanent link
Brent Ulbricht (2.5k11) | answered Jul 07 '10, 12:03 p.m.
JAZZ DEVELOPER
When a Build Forge agent is running under Windows, "echo on" is the
default value but it does not appear to have any effect. Any idea why
not? One thought I had was that Build Forge was stripping everything
that looked like a command echo, but that appears not to be the case.

--
Tim McDaniel, tmcd@panix.com


Hi Tim,

By default the Build Forge Agent will use the /Q switch when invoking cmd.exe, and this disables echoing completely, even if an "echo on" command is issued.

The "shell" setting in BFAgent.conf could be changed to override this, but it may have strange side-effects, such as having the command text show up as part of the value during collector run commands and possibly breaking variable expansion in some instances.

This is some information about the shell setting from the documentation.

shell shell_name
This setting specifies the default shell. Internal defaults are as follows:

* Windows: shell cmd.exe /q /c "%s" unless the following settings are used:
o If the cygwin setting is used, the default is shell C:\cygwin\bin\bash.exe --login -c "%s"
o If the cygwin setting is not used, the default is shell cmd.exe /u /q /c "%s"
* UNIX or Linux: The shell set for the user account, or /bin/sh if the user's shell can not be determined. Note that you cannot specify parameters in this setting, but you can use the shellflag setting to pass them. The agent automatically forces the default to be a logon shell by inserting a hyphen. For example, /bin/ksh is sent as -ksh. If shell is set explicitly, then nologonshell is set implicitly. See nologonshell.
* System i: Set the shell value to /bin/sh

You can override this setting from within a step. A step that starts with a line containing #! overrides the shell setting and the nologonshell setting is used to run the step commands.



Your best solution may be to override the shell only within those steps where you wish to explicitly control echo. For example:

Step Command Text
#!cmd.exe /c
@echo off
not_echoed
not_echoed
@echo on
echoed
@not_echoed
echoed
echoed

bju

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.