Executing a script file in Batch/Command mode via ./runfluidscript-bundled.sh one can specify the -e parameter for echoing or not the commands.
Some problems/inconsistencies seem to appear when also the Initialization Script is involved (File > Options > FluidShell > Script).
Everything is OK when -e is set to true (default value), all commands are echoed as expected.
Problems appear when -e is set to false, a server connection is specified and the 'Execute Script for All Shells' option is Enabled.
Scenario:
* file script.txt contains echo FILE
, Init Script is set to echo INIT
, 'Execute Script for All Shells' is enabled
* enter command in Terminal: ./runfluidscript-bundled.sh -fscript.txt -cMY-SERVER -efalse
* output is:
echo START<---Not OK, command should not be echoed
START
FILE
The other 3 ways of combining the -c param with the mentioned option seem to work OK.
Tested using ADStudio 12.0.4 on Ubuntu 12.10.
I think this is probably because the 'Echo Commands' flag in your MY-SERVER properties is on. Can you please confirm?
In the current RunFluidScript implementation:
(1) if there is a server property file involved, flags defined in the server property file are used to execute both global script and server specific script; the command line options only affect the script specified by -f option.
(2) if No server property file involved, then the command line options are applied to both global script as well as the script defined by -f option.
I will discuss with Niels to see whether we want to make change to (1)/(2) above.
Discussed with Niels, the current implementation is incorrect. Fixed, SVN r30030. See below for correct behavior.
(1) Global init script (the one defined by File->Options->FluidShell->Script)
This script will be executed if
(a) File->Options->FluidShell->'Execute Script for all Shells' is set to true,
(b) user open a FS interactively, or run FS in batch mode.
When this script gets executed, only options listed below would take effect:
File->Options->FluidShell->'Stop on SQL Exception'
File->Options->FluidShell->'Stop on Command Exception'
File->Options->FluidShell->'Echo Commands'
(2) Server init script (the one defined in the Server Properties)
This script will be executed if
(a) user open a FS interactively on a Server node, or
(b) user run FS in batch mode with -c option supplied.
When this script gets executed, only options listed below would take effect:
Server Properties->FluidShell->General->'Stop on SQL Exception'
Server Properties->FluidShell->General->'Stop on Command Exception'
Server Properties->FluidShell->General->'Echo Commands'
(3) Running FS in batch mode
The following options passed to RunFluidShell in batch mode
-ss stop-on-sql-exception
-sc stop-on-command-exception
-e echo-commands
only affect the script specified by -f option, but not Global/Server init scripts described above.
(4) \source command will never execute Global/Server init scripts.
Discussed with Niels, the current implementation is incorrect. Fixed, SVN r30030. See below for correct behavior.
(1) Global init script (the one defined by File->Options->FluidShell->Script)
This script will be executed if
(a) File->Options->FluidShell->'Execute Script for all Shells' is set to true,
(b) user open a FS interactively, or run FS in batch mode.
When this script gets executed, only options listed below would take effect:
File->Options->FluidShell->'Stop on SQL Exception'
File->Options->FluidShell->'Stop on Command Exception'
File->Options->FluidShell->'Echo Commands'
(2) Server init script (the one defined in the Server Properties)
This script will be executed if
(a) user open a FS interactively on a Server node, or
(b) user run FS in batch mode with -c option supplied.
When this script gets executed, only options listed below would take effect:
Server Properties->FluidShell->General->'Stop on SQL Exception'
Server Properties->FluidShell->General->'Stop on Command Exception'
Server Properties->FluidShell->General->'Echo Commands'
(3) Running FS in batch mode
The following options passed to RunFluidShell in batch mode
-ss stop-on-sql-exception
-sc stop-on-command-exception
-e echo-commands
only affect the script specified by -f option, but not Global/Server init scripts described above.
(4) \source command will never execute Global/Server init scripts.
Using ADStudio 12.0.5, verified the described behaviours.
Added echo INIT_GLOBAL
to File > Options > FS > Script, added echo INIT_MY_SERVER
to Server Properties > FS, added echo FILE
to script.txt.
The only problem seems to appear when opening a FS tab (or run FS in command mode) without a server connection and having 'Execute Script for All Shells' disabled, the expected INIT_GLOBAL message is not printed.
Using ADStudio 12.0.5, verified the described behaviours.
Added echo INIT_GLOBAL
to File > Options > FS > Script, added echo INIT_MY_SERVER
to Server Properties > FS, added echo FILE
to script.txt.
The only problem seems to appear when opening a FS tab (or run FS in command mode) without a server connection and having 'Execute Script for All Shells' disabled, the expected INIT_GLOBAL message is not printed.
> The only problem seems to appear when opening a FS tab (or run FS in command mode) without a server connection and having 'Execute Script for All Shells' disabled, the expected INIT_GLOBAL message is not printed.
If File->Options->FluidShell->'Execute Script for all Shells' is disabled, the global init script will never get executed. It is a correct behavior, see (1)-(a) above. The execution of the global init script has nothing to do with server connection, it is always determined by the File->Options->FluidShell->'Execute Script for all Shells' flag.
> The only problem seems to appear when opening a FS tab (or run FS in command mode) without a server connection and having 'Execute Script for All Shells' disabled, the expected INIT_GLOBAL message is not printed.
If File->Options->FluidShell->'Execute Script for all Shells' is disabled, the global init script will never get executed. It is a correct behavior, see (1)-(a) above. The execution of the global init script has nothing to do with server connection, it is always determined by the File->Options->FluidShell->'Execute Script for all Shells' flag.
> If File->Options->FluidShell->'Execute Script for all Shells' is disabled, the global init script will never get executed. It is a correct behavior, see (1)-(a) above. The execution of the global init script has nothing to do with server connection, it is always determined by the File->Options->FluidShell->'Execute Script for all Shells' flag.
Yes, I was also thinking about this, but I was not sure if between (1a) and (1b) would be an AND or an OR connection. I went with the OR because of the explanations given in the Options dialog.
Then the explanations should be changed:
i) the one from File > Options > FluidShell > Script
ii) the one from File > Options> FluidShell > Execute Script for all Shells
Currently, (i) & (ii) would sugest that the Global Init script should always be executed when opening a FluidShell tab without a server connection.
But is this the real intention? To remove the posibility to run an Init script if there is no server connection? Because this was requested before in #6802.
> If File->Options->FluidShell->'Execute Script for all Shells' is disabled, the global init script will never get executed. It is a correct behavior, see (1)-(a) above. The execution of the global init script has nothing to do with server connection, it is always determined by the File->Options->FluidShell->'Execute Script for all Shells' flag.
Yes, I was also thinking about this, but I was not sure if between (1a) and (1b) would be an AND or an OR connection. I went with the OR because of the explanations given in the Options dialog.
Then the explanations should be changed:
i) the one from File > Options > FluidShell > Script
ii) the one from File > Options> FluidShell > Execute Script for all Shells
Currently, (i) & (ii) would sugest that the Global Init script should always be executed when opening a FluidShell tab without a server connection.
But is this the real intention? To remove the posibility to run an Init script if there is no server connection? Because this was requested before in #6802.
OK, I will try to explain the condition one more time, hope it is clear this time:
(1) Global init script (the one defined by File->Options->FluidShell->Script)
This script will be executed if and only if File->Options->FluidShell->'Execute Script for all Shells' flag is set to TRUE.
If File->Options->FluidShell->'Execute Script for all Shells' flag is TRUE, the global init script is executed when you open a FS where 'open a FS' can be one of the followings:
(A) Open a FS interactively, "whether there is a server connection involved" does not matter.
(B) Open a FS in batch mode, "whether -c option is supplied" does not matter.
When a global init script is executed, whether it would respond to 'Stop on SQL Exception' or 'Stop on Command Exception' or 'Echo Commands' is determined by the following settings:
File->Options->FluidShell->'Stop on SQL Exception'
File->Options->FluidShell->'Stop on Command Exception'
File->Options->FluidShell->'Echo Commands'
If File->Options->FluidShell->'Execute Script for all Shells' flag is set to FALSE, the global init script will never be executed.
(2) Server init script (the one defined in the Server Properties)
This script is executed on any of the following conditions:
(A) Open a FS interactively on a Server node (i.e. with a server connection).
(B) Open a FS in batch mode with -c option supplied.
When a server init script is executed, whether it would respond to 'Stop on SQL Exception' or 'Stop on Command Exception' or 'Echo Commands' is determined by the following settings:
Server Properties->FluidShell->General->'Stop on SQL Exception'
Server Properties->FluidShell->General->'Stop on Command Exception'
Server Properties->FluidShell->General->'Echo Commands'
(3) Running FS in batch mode
The following options passed to RunFluidShell in batch mode
-ss stop-on-sql-exception
-sc stop-on-command-exception
-e echo-commands
only affect the script specified by -f option, but not Global/Server init scripts described above.
(4) \source command will never execute Global/Server init scripts.
OK, I will try to explain the condition one more time, hope it is clear this time:
(1) Global init script (the one defined by File->Options->FluidShell->Script)
This script will be executed if and only if File->Options->FluidShell->'Execute Script for all Shells' flag is set to TRUE.
If File->Options->FluidShell->'Execute Script for all Shells' flag is TRUE, the global init script is executed when you open a FS where 'open a FS' can be one of the followings:
(A) Open a FS interactively, "whether there is a server connection involved" does not matter.
(B) Open a FS in batch mode, "whether -c option is supplied" does not matter.
When a global init script is executed, whether it would respond to 'Stop on SQL Exception' or 'Stop on Command Exception' or 'Echo Commands' is determined by the following settings:
File->Options->FluidShell->'Stop on SQL Exception'
File->Options->FluidShell->'Stop on Command Exception'
File->Options->FluidShell->'Echo Commands'
If File->Options->FluidShell->'Execute Script for all Shells' flag is set to FALSE, the global init script will never be executed.
(2) Server init script (the one defined in the Server Properties)
This script is executed on any of the following conditions:
(A) Open a FS interactively on a Server node (i.e. with a server connection).
(B) Open a FS in batch mode with -c option supplied.
When a server init script is executed, whether it would respond to 'Stop on SQL Exception' or 'Stop on Command Exception' or 'Echo Commands' is determined by the following settings:
Server Properties->FluidShell->General->'Stop on SQL Exception'
Server Properties->FluidShell->General->'Stop on Command Exception'
Server Properties->FluidShell->General->'Echo Commands'
(3) Running FS in batch mode
The following options passed to RunFluidShell in batch mode
-ss stop-on-sql-exception
-sc stop-on-command-exception
-e echo-commands
only affect the script specified by -f option, but not Global/Server init scripts described above.
(4) \source command will never execute Global/Server init scripts.
The description text for 'Execute Script for all Shells' displayed in the File->Options dialog is out of date, changed it
from
Determines if the script is executed for all Shells or only for Shells with no database connections.
to
Determines if the script is executed for all Shells.
SVN trunk/r30072.
The description text for 'Execute Script for all Shells' displayed in the File->Options dialog is out of date, changed it
from
Determines if the script is executed for all Shells or only for Shells with no database connections.
to
Determines if the script is executed for all Shells.
SVN trunk/r30072.
The description from (i) says "Enter a shell script to be executed when opening a shell without a server connection."
From here I understand that this Global Script will be executed every time when there is NO server connection.
However you said that "This script will be executed if and only if File->Options->FluidShell->'Execute Script for all Shells' flag is set to TRUE.",
So the "Execute Script for all Shells" option (ii) works like an Enable/Disable option for (i) above, ADDING that it also applies for shells WITH a server connection.
My sugestions would be:
* change the description from (i) to "Enter a shell Script to be executed when opening a shell"
* change the naming & description from (ii) to "Execute Script" & "Determines if the Script is executed or not" respectively.
For consistency and also usability reasons (a usability reason would be that the user no longer has to delete the Init Script if he doesn't want to run it, but he now has only to Disable it), then the "Execute Script" option should be also added to the Server Init Script (Server Properties > FluidShell).
The description from (i) says "Enter a shell script to be executed when opening a shell without a server connection."
From here I understand that this Global Script will be executed every time when there is NO server connection.
However you said that "This script will be executed if and only if File->Options->FluidShell->'Execute Script for all Shells' flag is set to TRUE.",
So the "Execute Script for all Shells" option (ii) works like an Enable/Disable option for (i) above, ADDING that it also applies for shells WITH a server connection.
My sugestions would be:
* change the description from (i) to "Enter a shell Script to be executed when opening a shell"
* change the naming & description from (ii) to "Execute Script" & "Determines if the Script is executed or not" respectively.
For consistency and also usability reasons (a usability reason would be that the user no longer has to delete the Init Script if he doesn't want to run it, but he now has only to Disable it), then the "Execute Script" option should be also added to the Server Init Script (Server Properties > FluidShell).
I think we had some miscommuncation on the Global Init Script. The correct behavior is ...
1. If "Execute Script for all Shells" is disabled, then the Global Script is always executed with a FluidShell with no connection, and never executed with a FluidShell with a connection.
2. If "Execute Script for all Shells" is enabled, then the Global Script is always executed for any FluidShell, whether it has a connection or not.
3. The "Execute Script for all Shells" option description should be :
"Determines if the script is executed for all Shells or only for Shells with no database connections."
I think we had some miscommuncation on the Global Init Script. The correct behavior is ...
1. If "Execute Script for all Shells" is disabled, then the Global Script is always executed with a FluidShell with no connection, and never executed with a FluidShell with a connection.
2. If "Execute Script for all Shells" is enabled, then the Global Script is always executed for any FluidShell, whether it has a connection or not.
3. The "Execute Script for all Shells" option description should be :
"Determines if the script is executed for all Shells or only for Shells with no database connections."
Made change accordingly, SVN turnk/r30173. Niels, please back port r30173 to 12.0 branch.
The followings are still true:
(1) Global init script (the one defined by File->Options->FluidShell->Script)
When the global init script is executed, whether it would respond to 'Stop on SQL Exception' or 'Stop on Command Exception' or 'Echo Commands' is determined by the following settings:
File->Options->FluidShell->'Stop on SQL Exception'
File->Options->FluidShell->'Stop on Command Exception'
File->Options->FluidShell->'Echo Commands'
(2) Server init script (the one defined in the Server Properties)
When a server init script is executed, whether it would respond to 'Stop on SQL Exception' or 'Stop on Command Exception' or 'Echo Commands' is determined by the following settings:
Server Properties->FluidShell->General->'Stop on SQL Exception'
Server Properties->FluidShell->General->'Stop on Command Exception'
Server Properties->FluidShell->General->'Echo Commands'
(3) Running FS in batch mode
The following options passed to RunFluidShell in batch mode
-ss stop-on-sql-exception
-sc stop-on-command-exception
-e echo-commands
only affect the script specified by -f option, but not Global/Server init scripts described above.
Made change accordingly, SVN turnk/r30173. Niels, please back port r30173 to 12.0 branch.
The followings are still true:
(1) Global init script (the one defined by File->Options->FluidShell->Script)
When the global init script is executed, whether it would respond to 'Stop on SQL Exception' or 'Stop on Command Exception' or 'Echo Commands' is determined by the following settings:
File->Options->FluidShell->'Stop on SQL Exception'
File->Options->FluidShell->'Stop on Command Exception'
File->Options->FluidShell->'Echo Commands'
(2) Server init script (the one defined in the Server Properties)
When a server init script is executed, whether it would respond to 'Stop on SQL Exception' or 'Stop on Command Exception' or 'Echo Commands' is determined by the following settings:
Server Properties->FluidShell->General->'Stop on SQL Exception'
Server Properties->FluidShell->General->'Stop on Command Exception'
Server Properties->FluidShell->General->'Echo Commands'
(3) Running FS in batch mode
The following options passed to RunFluidShell in batch mode
-ss stop-on-sql-exception
-sc stop-on-command-exception
-e echo-commands
only affect the script specified by -f option, but not Global/Server init scripts described above.
Issue #7905 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build trunk/30030, 30072, 30173 |
No time estimate |
I think this is probably because the 'Echo Commands' flag in your MY-SERVER properties is on. Can you please confirm?
In the current RunFluidScript implementation:
(1) if there is a server property file involved, flags defined in the server property file are used to execute both global script and server specific script; the command line options only affect the script specified by -f option.
(2) if No server property file involved, then the command line options are applied to both global script as well as the script defined by -f option.
I will discuss with Niels to see whether we want to make change to (1)/(2) above.