
org.sonar.l10n.shellcheck.rules.shellcheck.SC3023.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-shellcheck-plugin Show documentation
Show all versions of sonar-shellcheck-plugin Show documentation
ShellCheck plugin for SonarQube
The newest version!
In POSIX sh, FDs outside of 0-9 are undefined.
(or "In dash, ... are not supported." when using dash
)
Problematic code
# Open FD #10 for writing
exec 10> file
Correct code
Either rewrite the script to only use FDs in the valid range, or switch to a shell that allows a larger range like bash
or ksh
.
Rationale
The shell grammar is only required to recognize a single digit before redirections to set the file descriptor, which limits the portable range to 0-9.
Exceptions
None.
Related resources
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!
© 2015 - 2025 Weber Informatics LLC | Privacy Policy