bash - Jenkins 更新语法错误 : end of file unexpected (expecting ")") Execute Shell

标签 bash shell jenkins

尝试在我的 Jenkins 服务器上运行构建时出现错误。以下是输出显示的内容。这是在我更新到最新版本的 Jenkins 之后发生的。我还验证了所有插件都是最新的。

[EnvInject] - Loading node environment variables.
[workspace] $ /bin/sh -xe /tmp/hudson229576663898687231.sh
/tmp/hudson229576663898687231.sh: 1: /tmp/hudson229576663898687231.sh: Syntax error: end of file unexpected (expecting ")")
Build step 'Execute shell' marked build as failure
Finished: FAILURE

进一步调试似乎每当我添加一个执行 shell 构建选项时都会抛出错误。例如在执行 shell block 中。

ls -al;

此外,Jenkins 安装在 Ubuntu 12.10 机器上。

最佳答案

经过进一步调试,我弄清楚了发生了什么。 Jenkins 使用默认为

#!/bin/sh

但似乎不是默认的。我在我的命令脚本之上添加了它,现在它工作得很好。

关于bash - Jenkins 更新语法错误 : end of file unexpected (expecting ")") Execute Shell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22204732/

相关文章:

linux - 如何用sed正确检测和替换撇号(')?

macos - Mac 上的默认终端 $PATH 位于何处?

bash - 密码中的星号字符 - 登录失败

shell - 减去相应的行

bash - Grep spotify songname 从 html doc 到文本文件

Jenkins Pipeline - 在阶段之间传递 Artifact URL

bash - 如何禁用 devtoolset-8?

bash - 在两个分隔符之间提取多行数据

java - 生成EAR文件时如何在代码中创建application.xml?

docker - Openshift Jenkins(2)— docker :未找到命令