Hi,

it's more a bash question than jenkins, but the point is, Jenkins calls the bash with -x option enabled, which also prints the invoked commands, with a "+" prefix You can disable it with with the "set +x" command form your script, try it with this snippet:

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
#!/bin/bash -x

echo "prints the command as well"

set +x
echo "this just prints the echo's output"

set -x
echo "also prints the command itself again"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""


br,
Zoltan



On 04/11/2012 11:15 AM, David Aldrich wrote:

Hi

Some of my Jenkins jobs run bash shell scripts that are stored in Subversion. The scripts are quite complex and may contain 'for' loops:

For example:

for Simulation in $SimulationsList_1

do

    cd $SIM_PATH_1/$Simulation

    zip -qr $SIM_PATH_1/$Simulation'_'$BUILD_NUMBER *

done

The Jenkins console output for such a loop is quite noisy. For example, the 'for' statement is printed in every iteration.

Is there a way of making a script command silent? For example, I would like to make the line containing 'for' silent.

Best regards

David





Reply via email to