Jenkins displays an echo command on the console output page

I have the code below in the Jenkins shell. My requirement is to display a parameter servernameon each line for output to console output. I used the echo and got the server names and they are displayed on the console.

Code:
echo ${Server} PS_EXE="/cygdrive/powershell.exe"
echo ${Server} "wget user=$User pwd= $pwd http://artifactory/dev-package.zip"
echo ${Server} "sleep 20s"

All lines contain an echo server for displaying server names

Output:
+echo SD998.domain.com PS_EXE="/cygdrive/powershell.exe"
SD998.domain.com PS_EXE="/cygdrive/powershell.exe"
+echo SD999.domain.com "wget user=$User pwd= $pwd http://artifactory/dev-package.zip"
SD999.domain.com "wget user=$User pwd= $pwd http://artifactory/dev-package.zip"

The echo statement is output to console output, and then output is output. I need to remove the echo related instructions from Console output. Please help me achieve this.

+4
source share
1 answer

If you are running a task on a slave Linux, do the following:

#!/bin/bash
echo ${Server} PS_EXE="/cygdrive/powershell.exe"
echo ${Server} "wget user=$User pwd= $pwd http://artifactory/dev-package.zip"
echo ${Server} "sleep 20s"

Windows, windows:

@echo %Server% PS_EXE="/cygdrive/powershell.exe"
@echo %Server% "wget user=%User% pwd= %pwd% http://artifactory/dev-package.zip"
@echo %Server% "sleep 20s"
+1

Source: https://habr.com/ru/post/1655327/


All Articles