shellCheck
1.1、shellCheck简介
是什么 ?:a static analysis tool for shell scripts
开发语言:haskell
官方主页:https://www.shellcheck.net
源码仓库:https://github.com/koalaman/shellcheck
1.2、通过包管理器安装shellCheck
操作系统包管理器安装命令
Windowsscoopscoop install shellcheck
WindowsChocolateychoco install -y shellcheck
macOSHomeBrewbrew install shellcheck
GNU/LinuxLinuxBrewbrew install shellcheck
aptsudo apt-get install -y shellcheck
CentOSyumsudo yum install -y ShellCheck
dnfsudo dnf install -y ShellCheck
openSUSEzyppersudo zypper install -y ShellCheck

Arch Linux

ArcoLinux

Manjaro Linux

pacmansudo pacman -Syyu --noconfirm
sudo pacman -S    --noconfirm shellcheck
Gentoo LinuxPortagesudo emerge shellcheck
1.3、shellcheck命令
shellcheck [option]... shellScriptFile

示例:

shellcheck ~/tool.sh