"echo on" doesn't work
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
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
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:
#!cmd.exe /c
@echo off
not_echoed
not_echoed
@echo on
echoed
@not_echoed
echoed
echoed
bju