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/profile
cause, you need to add a line in the script shell script calls jenkins front, #!/bin/bash -ilex
allows for the bash login shell and interactive shell with the -i parameter and -l parameters, you can read /etc/profile
and ~/.bash_profile
other 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