![]() Utilities/Zscaler-osx-1.5.1.5-installer.app/Contents/MacOS/installbuilder.sh. Share Improve this answer Follow answered at 14:27 Appleoddity 11. That shouldn't be a worry for ksh, mksh, bash, zsh, or the Bourne shell, though - all of those do basically the same thing as I did explicitly above with exec. Wow, nice of ZScaler to just take my script and remove my name - 194167. 2 Answers Sorted by: 2 Start your batch file with: ECHO OFF And redirect all command output by appending: >NUL 2>&1 This redirects 'Standard Out' (1) to NUL and redirects 'Standard Error' (2) to (1). command > /dev/null: redirects the output of command (stdout) to /dev/null 2. When you use command substitution you are telling it to write stdout to the variable TOTALFILES. To hide the output of any command usually the stdout and stderr are redirected to /dev/null. Also it wont write stdout to your file either. To reset a flag I'd suggest two options: Call set +x in the body of your script. ![]() ![]() e makes the script exit if any command inside returns non-zero exit status. Beware of high output commands in though for dash, yash, or some other shells which do here-documents with pipes - I think it may be possible in those shells to fill the pipe buffer (at a default of around 128kb on linuxes) and so deadlock. 1 Answer Sorted by: 0 It does not 'write the o/p to std output'. By default Jenkins starts shell scripts with flags -xe. which, in most shells, works much like the other, except that you can call it like: divert some simple-command with args. try adding -help as a command switch and look for 'quiet' this should suppress the output, or just launch from GUI. Perhaps a more convenient solution on linux systems: >&3 2>&3 || Because the temp file is deleted ahead of time it cannot be read by any process but the current shell and its children on its file descriptor (barring sneaky /proc/$pid/fd snoops with appropriate permissions), and it does not require cleaning up when you're through. It will buffer the output of each command into a deleted temporary file, and afterward siphon its output into either /dev/null or stderr depending on whether or not its return status was not zero. That might help you narrow down the issue. Then look at the results - where are these messages in the transcript If you use a profile file, then start the transcript in the profile rather than the script itself. # do this bit once at the top of your script Go to the top of the script and start a transcript to a local directory and try to reproduce the issue.
0 Comments
Leave a Reply. |