Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
OT - running shell script displays an error message while it should not
- 
					
					
					
					
Hello
I have a shell script, which clone a git repo and run few command.
Directly from the server, it is working properly.From Otter, as SHCall, it reports ERROR while is it just echo or result of the command line.
Results below of a small script shellecho ==> install-monitor sur $(hostname) git clone https://oauth:********@********/monitor.git /opt/monitorDEBUG: 2023-07-17 11:54:18Z - Job will be run against servers sequentially (not asynchronously). DEBUG: 2023-07-17 11:54:18Z - Targeting servers: VMXXXXXX DEBUG: 2023-07-17 11:54:18Z - Beginning execution run... INFO : 2023-07-17 11:54:19Z - ==> install-monitor sur VMXXXXXX ERROR: 2023-07-17 11:54:20Z - Cloning into '/opt/monitor'...How to avoid such behaviour and keep real ERROR
I have plenty of working shell scripts I have to run through Otter
Best regards
PhilippeRunning : Otter Version 2022.11 / docker
 - 
					
					
					
					
When text is written to the
stderrstream, Otter will interpret this as an error. Unfortunately a few tools (includinggit) like to write to thestderr, even though it's not an error, and will use the exit code to indicate an error instead.There are a handful of ways to deal with this:
- set 
ErrorOutputLogLevelin theSHExecoperation - use 
try/catch/force normalin OtterScript - modify your script to redirect output
 
Redirecting is strongly recommended, and you can do it with
2>&1in your script. Then you can test the exit code of the tool, and write to the error stream so Otter can pick it up as an error.Cheers,
Alana
 - set 
 -