We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#!/bin/bash
#!/bin/sh
# 没有 shebang 行 echo "Hello, World!"
#!/bin/bash echo "Hello, World!"
#!/bin/sh echo "Hello, World!"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
lint 解释
#!/bin/bash
或#!/bin/sh
),导致 shellcheck 无法确定目标 Shell 的类型。没有明确的 shebang,shellcheck 无法提供针对特定 Shell 的准确建议和最佳实践,因为不同的 Shell 可能支持不同的语法和功能。错误用法
正确用法
如果你的脚本需要使用 Bash 特有的功能,可以添加以下 shebang:
如果你希望脚本能够在任何 POSIX 兼容的 Shell 中运行,可以使用:
The text was updated successfully, but these errors were encountered: