I have a bash script postCloneSetup.sh:
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path"
printf 'Updating submodules for project\r\n'
git submodule update --init --recursive
printf '\r\nInitializing git hooks\n'
./GitHooks-BackEnd/init-hooks
printf '\r\nInitializing Submodule1\r\n'
$(./Submodule1/postCloneSetup.sh)
printf '\r\nInitializing Submodule2\r\n'
$(./Submodule2/postCloneSetup.sh)
I trigger a bash script from Windows command prompt.
postCloneSetup.sh
It opens another window and then returns. The window it spawned stays open and logs output text.
I want to capture the output from the spawned window (the text written to the console) and return that to the Windows command prompt.
I would prefer to use something like
$(postCloneSetup.sh) // Linux for capturing output to current context
for the Windows command prompt.
I'd prefer not to modify postCloneSetup.sh. I know I could have it write out to a file with
exec &> postCloneSetupLog.log
but then I must wait and manually run
type postCloneSetupLog.log
to see the output in the console. This is not possible for integrating into a CI engine, which is my goal.
How can I capture the output from the spawned console in one command?
postCloneSetup.sh
, but the other "script" is just running it from the Windows command prompt. In the CI engine that is what is happening.