jenkins execute shell commands, and sometimes will prompt "Command not found" ---- treatment program

1, if the login linux, shell command can not be executed, the same prompt "Command not found", it is the environment variable settings fail, you need to configure the environment variables,/etc/profile

2, if the login linux, shell command can be executed, it is not loaded jenkins /etc/profilecause, you need to add a line in the script shell script calls jenkins front, #!/bin/bash -ilexallows for the bash login shell and interactive shell with the -i parameter and -l parameters, you can read /etc/profileand ~/.bash_profileother documents, as follows "

#!/bin/bash -ilex
cd..

And other shell commands

For parameter e represents the error once, to exit the current shell, x represents a parameter may be displayed each command executed

Transfer: https://blog.csdn.net/huodoubi/article/details/56845306

Published 46 original articles · won praise 13 · views 60000 +

Guess you like

Origin blog.csdn.net/luliuliu1234/article/details/80932788