在编写shell程序时,我们经常使用/bin/sh和/bin/bash.我经常使用bash,但我不知道它们之间有什么区别.
bash和之间的主要区别是sh什么?
我们究竟需要意识到在编程时bash和sh?
我正在私有 GitHub 存储库和 Jenkins 构建之间设置 webhook 集成。我专门使用 Job DSL groovy 脚本配置作业(我愿意切换到另一种编程作业配置机制,但我不会接受任何要求我手动配置作业的答案)。II 想设置一个提交状态上下文和一组基于构建状态的自定义消息。
Jenkins 中嵌入的Job DSL API 文档没有帮助,只给了我这个签名:githubPullRequest(Closure closure),但没有告诉我如何构建合适的闭包。
以下是我的工作 DSL 的相关部分:
triggers {
githubPush()
githubPullRequest {
useGitHubHooks()
buildStatus {
completedStatus('SUCCESS', 'Build succeeded!')
completedStatus('FAILURE', 'Build failed. ')
completedStatus('ERROR', 'Build errored. This is probably a problem with Jenkins or related infrastructure and not an issue with your code changes.')
}
}
}
(...)
scm {
git {
remote {
github('privateorg/myrepo', 'ssh')
credentials('my-credential-id')
refspec('+refs/pull/*:refs/remotes/origin/pr/*')
}
branch('${sha1}')
}
} …Run Code Online (Sandbox Code Playgroud) 当我使用用户名和密码手动sftp时,它工作正常,而使用curl时,它会失败。相同的脚本将成功连接到其他服务器,而不会出现问题。因为我可以手动登录,并且其他客户端没有问题,所以服务器管理员的帮助不大。
这是卷曲失败的尝试:
curl -v --insecure --user username:password sftp://someurl.com
* Trying 199.187.***.***...
* Connected to someurl.com (199.187.***.***) port 22 (#0)
* SSH MD5 fingerprint: 6831eae63f230952a1775e0f67f80e7b
* SSH authentication methods available: publickey,gssapi-keyex,gssapi with-mic,password
* Using SSH public key file '(nil)'
* Using SSH private key file ''
* SSH public key authentication failed: Unable to extract public key from private key file: Unable to open private key file
* Failure connecting to agent
* Authentication failure
* Closing connection 0
curl: (67) …Run Code Online (Sandbox Code Playgroud)