Topics: Scripting
ShellCheck
ShellCheck is a tool that can be used to check the integrity of shell scripts, which can be very useful while developing shell scripts, as it may indicate where issues are within shell scripts. It works with different shells, such as Bash, and the Korn shell.
Visit www.shellcheck.net to get information about how to obtain the tool.
For Red Hat Enterprise Linux based systems (and its derivatives), it can simply be installed as follows:
Or on Fedora:# yum -y install epel-release # yum install ShellCheck
ShellCheck helps to identify potential issues with check scripts, and thus can be an important tool for shell script developers. Even if a shell script works fine, the ShellCheck tool can be used to identify potential improvements to shell scripts. Considering that UNIX Health Check software is completely written in shell scripts, it is a tool used by us quite a lot to aid in ensuring that our code is valid and correct.# dnf install ShellCheck
To check a specific script, e.g. to check script test.sh, run:
For more information about the use of ShellCheck, run:# shellcheck test.sh
# man shellcheck