{"id":13394102,"url":"https://github.com/koalaman/shellcheck","last_synced_at":"2025-05-12T16:19:01.543Z","repository":{"id":5529217,"uuid":"6731432","full_name":"koalaman/shellcheck","owner":"koalaman","description":"ShellCheck, a static analysis tool for shell scripts","archived":false,"fork":false,"pushed_at":"2025-04-27T23:47:14.000Z","size":5487,"stargazers_count":37357,"open_issues_count":1114,"forks_count":1814,"subscribers_count":413,"default_branch":"master","last_synced_at":"2025-05-12T16:18:54.470Z","etag":null,"topics":["bash","developer-tools","haskell","linter","shell","static-analysis"],"latest_commit_sha":null,"homepage":"https://www.shellcheck.net","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"htmlacademy-adaptive/28813-pink","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koalaman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-11-17T03:15:11.000Z","updated_at":"2025-05-12T15:59:07.000Z","dependencies_parsed_at":"2024-04-05T03:27:06.021Z","dependency_job_id":"73c56e6a-f601-4ab9-9b0f-813cd17d1a46","html_url":"https://github.com/koalaman/shellcheck","commit_stats":{"total_commits":1631,"total_committers":147,"mean_commits":"11.095238095238095","dds":0.3053341508277131,"last_synced_commit":"2a95bc6be3c9fe411e1ddb96e78b467ef2347bdb"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koalaman%2Fshellcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koalaman%2Fshellcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koalaman%2Fshellcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koalaman%2Fshellcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koalaman","download_url":"https://codeload.github.com/koalaman/shellcheck/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253774593,"owners_count":21962199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","developer-tools","haskell","linter","shell","static-analysis"],"created_at":"2024-07-30T17:01:09.036Z","updated_at":"2025-05-12T16:19:01.491Z","avatar_url":"https://github.com/koalaman.png","language":"Haskell","readme":"[![Build Status](https://github.com/koalaman/shellcheck/actions/workflows/build.yml/badge.svg)](https://github.com/koalaman/shellcheck/actions/workflows/build.yml)\n\n\n# ShellCheck - A shell script static analysis tool\n\nShellCheck is a GPLv3 tool that gives warnings and suggestions for bash/sh shell scripts:\n\n![Screenshot of a terminal showing problematic shell script lines highlighted](doc/terminal.png)\n\nThe goals of ShellCheck are\n\n* To point out and clarify typical beginner's syntax issues that cause a shell\n  to give cryptic error messages.\n\n* To point out and clarify typical intermediate level semantic problems that\n  cause a shell to behave strangely and counter-intuitively.\n\n* To point out subtle caveats, corner cases and pitfalls that may cause an\n  advanced user's otherwise working script to fail under future circumstances.\n\nSee [the gallery of bad code](README.md#user-content-gallery-of-bad-code) for examples of what ShellCheck can help you identify!\n\n## Table of Contents\n\n* [How to use](#how-to-use)\n  * [On the web](#on-the-web)\n  * [From your terminal](#from-your-terminal)\n  * [In your editor](#in-your-editor)\n  * [In your build or test suites](#in-your-build-or-test-suites)\n* [Installing](#installing)\n* [Compiling from source](#compiling-from-source)\n  * [Installing Cabal](#installing-cabal)\n  * [Compiling ShellCheck](#compiling-shellcheck)\n  * [Running tests](#running-tests)\n* [Gallery of bad code](#gallery-of-bad-code)\n  * [Quoting](#quoting)\n  * [Conditionals](#conditionals)\n  * [Frequently misused commands](#frequently-misused-commands)\n  * [Common beginner's mistakes](#common-beginners-mistakes)\n  * [Style](#style)\n  * [Data and typing errors](#data-and-typing-errors)\n  * [Robustness](#robustness)\n  * [Portability](#portability)\n  * [Miscellaneous](#miscellaneous)\n* [Testimonials](#testimonials)\n* [Ignoring issues](#ignoring-issues)\n* [Reporting bugs](#reporting-bugs)\n* [Contributing](#contributing)\n* [Copyright](#copyright)\n* [Other Resources](#other-resources)\n\n## How to use\n\nThere are a number of ways to use ShellCheck!\n\n### On the web\n\nPaste a shell script on \u003chttps://www.shellcheck.net\u003e for instant feedback.\n\n[ShellCheck.net](https://www.shellcheck.net) is always synchronized to the latest git commit, and is the easiest way to give ShellCheck a go. Tell your friends!\n\n### From your terminal\n\nRun `shellcheck yourscript` in your terminal for instant output, as seen above.\n\n### In your editor\n\nYou can see ShellCheck suggestions directly in a variety of editors.\n\n* Vim, through [ALE](https://github.com/w0rp/ale), [Neomake](https://github.com/neomake/neomake), or [Syntastic](https://github.com/scrooloose/syntastic):\n\n![Screenshot of Vim showing inlined shellcheck feedback](doc/vim-syntastic.png).\n\n* Emacs, through [Flycheck](https://github.com/flycheck/flycheck) or [Flymake](https://github.com/federicotdn/flymake-shellcheck):\n\n![Screenshot of emacs showing inlined shellcheck feedback](doc/emacs-flycheck.png).\n\n* Sublime, through [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter-shellcheck).\n\n* Pulsar Edit (former Atom), through [linter-shellcheck-pulsar](https://github.com/pulsar-cooperative/linter-shellcheck-pulsar).\n\n* VSCode, through [vscode-shellcheck](https://github.com/timonwong/vscode-shellcheck).\n\n* Most other editors, through [GCC error compatibility](shellcheck.1.md#user-content-formats).\n\n### In your build or test suites\n\nWhile ShellCheck is mostly intended for interactive use, it can easily be added to builds or test suites.\nIt makes canonical use of exit codes, so you can just add a `shellcheck` command as part of the process.\n\nFor example, in a Makefile:\n\n```Makefile\ncheck-scripts:\n    # Fail if any of these files have warnings\n    shellcheck myscripts/*.sh\n```\n\nor in a Travis CI `.travis.yml` file:\n\n```yaml\nscript:\n  # Fail if any of these files have warnings\n  - shellcheck myscripts/*.sh\n```\n\nServices and platforms that have ShellCheck pre-installed and ready to use:\n\n* [Travis CI](https://travis-ci.org/)\n* [Codacy](https://www.codacy.com/)\n* [Code Climate](https://codeclimate.com/)\n* [Code Factor](https://www.codefactor.io/)\n* [Codety](https://www.codety.io/) via the [Codety Scanner](https://github.com/codetyio/codety-scanner)\n* [CircleCI](https://circleci.com) via the [ShellCheck Orb](https://circleci.com/orbs/registry/orb/circleci/shellcheck)\n* [Github](https://github.com/features/actions) (only Linux)\n* [Trunk Check](https://trunk.io/products/check) (universal linter; [allows you to explicitly version your shellcheck install](https://github.com/trunk-io/plugins/blob/bcbb361dcdbe4619af51ea7db474d7fb87540d20/.trunk/trunk.yaml#L32)) via the [shellcheck plugin](https://github.com/trunk-io/plugins/blob/main/linters/shellcheck/plugin.yaml)\n* [CodeRabbit](https://coderabbit.ai/)\n\nMost other services, including [GitLab](https://about.gitlab.com/), let you install\nShellCheck yourself, either through the system's package manager (see [Installing](#installing)),\nor by downloading and unpacking a [binary release](#installing-a-pre-compiled-binary).\n\nIt's a good idea to manually install a specific ShellCheck version regardless. This avoids\nany surprise build breaks when a new version with new warnings is published.\n\nFor customized filtering or reporting, ShellCheck can output simple JSON, CheckStyle compatible XML,\nGCC compatible warnings as well as human readable text (with or without ANSI colors). See the\n[Integration](https://github.com/koalaman/shellcheck/wiki/Integration) wiki page for more documentation.\n\n## Installing\n\nThe easiest way to install ShellCheck locally is through your package manager.\n\nOn systems with Cabal (installs to `~/.cabal/bin`):\n\n    cabal update\n    cabal install ShellCheck\n\nOn systems with Stack (installs to `~/.local/bin`):\n\n    stack update\n    stack install ShellCheck\n\nOn Debian based distros:\n\n    sudo apt install shellcheck\n\nOn Arch Linux based distros:\n\n    pacman -S shellcheck\n\nor get the dependency free [shellcheck-bin](https://aur.archlinux.org/packages/shellcheck-bin/) from the AUR.\n\nOn Gentoo based distros:\n\n    emerge --ask shellcheck\n\nOn EPEL based distros:\n\n    sudo yum -y install epel-release\n    sudo yum install ShellCheck\n\nOn Fedora based distros:\n\n    dnf install ShellCheck\n\nOn FreeBSD:\n\n    pkg install hs-ShellCheck\n\nOn macOS (OS X) with Homebrew:\n\n    brew install shellcheck\n\nOr with MacPorts:\n\n    sudo port install shellcheck\n\nOn OpenBSD:\n\n    pkg_add shellcheck\n\nOn openSUSE\n\n    zypper in ShellCheck\n\nOr use OneClickInstall - \u003chttps://software.opensuse.org/package/ShellCheck\u003e\n\nOn Solus:\n\n    eopkg install shellcheck\n\nOn Windows (via [chocolatey](https://chocolatey.org/packages/shellcheck)):\n\n```cmd\nC:\\\u003e choco install shellcheck\n```\n\nOr Windows (via [winget](https://github.com/microsoft/winget-pkgs)):\n\n```cmd\nC:\\\u003e winget install --id koalaman.shellcheck\n```\n\nOr Windows (via [scoop](http://scoop.sh)):\n\n```cmd\nC:\\\u003e scoop install shellcheck\n```\n\nFrom [conda-forge](https://anaconda.org/conda-forge/shellcheck):\n\n    conda install -c conda-forge shellcheck\n\nFrom Snap Store:\n\n    snap install --channel=edge shellcheck\n\nFrom Docker Hub:\n\n```sh\ndocker run --rm -v \"$PWD:/mnt\" koalaman/shellcheck:stable myscript\n# Or :v0.4.7 for that version, or :latest for daily builds\n```\n\nor use `koalaman/shellcheck-alpine` if you want a larger Alpine Linux based image to extend. It works exactly like a regular Alpine image, but has shellcheck preinstalled.\n\nUsing the [nix package manager](https://nixos.org/nix):\n```sh\nnix-env -iA nixpkgs.shellcheck\n```\n\nUsing the [Flox package manager](https://flox.dev/)\n```sh\nflox install shellcheck\n```\n\nAlternatively, you can download pre-compiled binaries for the latest release here:\n\n* [Linux, x86_64](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz) (statically linked)\n* [Linux, armv6hf](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.armv6hf.tar.xz), i.e. Raspberry Pi (statically linked)\n* [Linux, aarch64](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.aarch64.tar.xz) aka ARM64 (statically linked)\n* [macOS, aarch64](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.darwin.aarch64.tar.xz)\n* [macOS, x86_64](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.darwin.x86_64.tar.xz)\n* [Windows, x86](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.zip)\n\nor see the [GitHub Releases](https://github.com/koalaman/shellcheck/releases) for other releases\n(including the [latest](https://github.com/koalaman/shellcheck/releases/tag/latest) meta-release for daily git builds).\n\nThere are currently no official binaries for Apple Silicon, but third party builds are available via\n[ShellCheck for Visual Studio Code](https://github.com/vscode-shellcheck/shellcheck-binaries/releases).\n\nDistro packages already come with a `man` page. If you are building from source, it can be installed with:\n\n```console\npandoc -s -f markdown-smart -t man shellcheck.1.md -o shellcheck.1\nsudo mv shellcheck.1 /usr/share/man/man1\n```\n\n### pre-commit\n\nTo run ShellCheck via [pre-commit](https://pre-commit.com/), add the hook to your `.pre-commit-config.yaml`:\n\n```\nrepos:\n-   repo: https://github.com/koalaman/shellcheck-precommit\n    rev: v0.7.2\n    hooks:\n    -   id: shellcheck\n#       args: [\"--severity=warning\"]  # Optionally only show errors and warnings\n```\n\n### Travis CI\n\nTravis CI has now integrated ShellCheck by default, so you don't need to manually install it.\n\nIf you still want to do so in order to upgrade at your leisure or ensure you're\nusing the latest release, follow the steps below to install a binary version.\n\n### Installing a pre-compiled binary\n\nThe pre-compiled binaries come in `tar.xz` files. To decompress them, make sure\n`xz` is installed.\nOn Debian/Ubuntu/Mint, you can `apt install xz-utils`.\nOn Redhat/Fedora/CentOS, `yum -y install xz`.\n\nA simple installer may do something like:\n\n```bash\nscversion=\"stable\" # or \"v0.4.7\", or \"latest\"\nwget -qO- \"https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz\" | tar -xJv\ncp \"shellcheck-${scversion}/shellcheck\" /usr/bin/\nshellcheck --version\n```\n\n## Compiling from source\n\nThis section describes how to build ShellCheck from a source directory. ShellCheck is written in Haskell and requires 2GB of RAM to compile.\n\n### Installing Cabal\n\nShellCheck is built and packaged using Cabal. Install the package `cabal-install` from your system's package manager (with e.g. `apt-get`, `brew`, `emerge`, `yum`, or `zypper`).\n\nOn macOS (OS X), you can do a fast install of Cabal using brew, which takes a couple of minutes instead of more than 30 minutes if you try to compile it from source.\n\n    $ brew install cabal-install\n\nOn MacPorts, the package is instead called `hs-cabal-install`, while native Windows users should install the latest version of the Haskell platform from \u003chttps://www.haskell.org/platform/\u003e\n\nVerify that `cabal` is installed and update its dependency list with\n\n    $ cabal update\n\n### Compiling ShellCheck\n\n`git clone` this repository, and `cd` to the ShellCheck source directory to build/install:\n\n    $ cabal install\n\nThis will compile ShellCheck and install it to your `~/.cabal/bin` directory.\n\nAdd this directory to your `PATH` (for bash, add this to your `~/.bashrc`):\n\n```sh\nexport PATH=\"$HOME/.cabal/bin:$PATH\"\n```\n\nLog out and in again, and verify that your PATH is set up correctly:\n\n```sh\n$ which shellcheck\n~/.cabal/bin/shellcheck\n```\n\nOn native Windows, the `PATH` should already be set up, but the system\nmay use a legacy codepage. In `cmd.exe`, `powershell.exe` and Powershell ISE,\nmake sure to use a TrueType font, not a Raster font, and set the active\ncodepage to UTF-8 (65001) with `chcp`:\n\n```cmd\nchcp 65001\n```\n\nIn Powershell ISE, you may need to additionally update the output encoding:\n\n```powershell\n[Console]::OutputEncoding = [System.Text.Encoding]::UTF8\n```\n\n### Running tests\n\nTo run the unit test suite:\n\n    $ cabal test\n\n## Gallery of bad code\n\nSo what kind of things does ShellCheck look for? Here is an incomplete list of detected issues.\n\n### Quoting\n\nShellCheck can recognize several types of incorrect quoting:\n\n```sh\necho $1                           # Unquoted variables\nfind . -name *.ogg                # Unquoted find/grep patterns\nrm \"~/my file.txt\"                # Quoted tilde expansion\nv='--verbose=\"true\"'; cmd $v      # Literal quotes in variables\nfor f in \"*.ogg\"                  # Incorrectly quoted 'for' loops\ntouch $@                          # Unquoted $@\necho 'Don't forget to restart!'   # Singlequote closed by apostrophe\necho 'Don\\'t try this at home'    # Attempting to escape ' in ''\necho 'Path is $PATH'              # Variables in single quotes\ntrap \"echo Took ${SECONDS}s\" 0    # Prematurely expanded trap\nunset var[i]                      # Array index treated as glob\n```\n\n### Conditionals\n\nShellCheck can recognize many types of incorrect test statements.\n\n```sh\n[[ n != 0 ]]                      # Constant test expressions\n[[ -e *.mpg ]]                    # Existence checks of globs\n[[ $foo==0 ]]                     # Always true due to missing spaces\n[[ -n \"$foo \" ]]                  # Always true due to literals\n[[ $foo =~ \"fo+\" ]]               # Quoted regex in =~\n[ foo =~ re ]                     # Unsupported [ ] operators\n[ $1 -eq \"shellcheck\" ]           # Numerical comparison of strings\n[ $n \u0026\u0026 $m ]                      # \u0026\u0026 in [ .. ]\n[ grep -q foo file ]              # Command without $(..)\n[[ \"$$file\" == *.jpg ]]           # Comparisons that can't succeed\n(( 1 -lt 2 ))                     # Using test operators in ((..))\n[ x ] \u0026 [ y ] | [ z ]             # Accidental backgrounding and piping\n```\n\n### Frequently misused commands\n\nShellCheck can recognize instances where commands are used incorrectly:\n\n```sh\ngrep '*foo*' file                 # Globs in regex contexts\nfind . -exec foo {} \u0026\u0026 bar {} \\;  # Prematurely terminated find -exec\nsudo echo 'Var=42' \u003e /etc/profile # Redirecting sudo\ntime --format=%s sleep 10         # Passing time(1) flags to time builtin\nwhile read h; do ssh \"$h\" uptime  # Commands eating while loop input\nalias archive='mv $1 /backup'     # Defining aliases with arguments\ntr -cd '[a-zA-Z0-9]'              # [] around ranges in tr\nexec foo; echo \"Done!\"            # Misused 'exec'\nfind -name \\*.bak -o -name \\*~ -delete  # Implicit precedence in find\n# find . -exec foo \u003e bar \\;       # Redirections in find\nf() { whoami; }; sudo f           # External use of internal functions\n```\n\n### Common beginner's mistakes\n\nShellCheck recognizes many common beginner's syntax errors:\n\n```sh\nvar = 42                          # Spaces around = in assignments\n$foo=42                           # $ in assignments\nfor $var in *; do ...             # $ in for loop variables\nvar$n=\"Hello\"                     # Wrong indirect assignment\necho ${var$n}                     # Wrong indirect reference\nvar=(1, 2, 3)                     # Comma separated arrays\narray=( [index] = value )         # Incorrect index initialization\necho $var[14]                     # Missing {} in array references\necho \"Argument 10 is $10\"         # Positional parameter misreference\nif $(myfunction); then ..; fi     # Wrapping commands in $()\nelse if othercondition; then ..   # Using 'else if'\nf; f() { echo \"hello world; }     # Using function before definition\n[ false ]                         # 'false' being true\nif ( -f file )                    # Using (..) instead of test\n```\n\n### Style\n\nShellCheck can make suggestions to improve style:\n\n```sh\n[[ -z $(find /tmp | grep mpg) ]]  # Use grep -q instead\na \u003e\u003e log; b \u003e\u003e log; c \u003e\u003e log      # Use a redirection block instead\necho \"The time is `date`\"         # Use $() instead\ncd dir; process *; cd ..;         # Use subshells instead\necho $[1+2]                       # Use standard $((..)) instead of old $[]\necho $(($RANDOM % 6))             # Don't use $ on variables in $((..))\necho \"$(date)\"                    # Useless use of echo\ncat file | grep foo               # Useless use of cat\n```\n\n### Data and typing errors\n\nShellCheck can recognize issues related to data and typing:\n\n```sh\nargs=\"$@\"                         # Assigning arrays to strings\nfiles=(foo bar); echo \"$files\"    # Referencing arrays as strings\ndeclare -A arr=(foo bar)          # Associative arrays without index\nprintf \"%s\\n\" \"Arguments: $@.\"    # Concatenating strings and arrays\n[[ $# \u003e 2 ]]                      # Comparing numbers as strings\nvar=World; echo \"Hello \" var      # Unused lowercase variables\necho \"Hello $name\"                # Unassigned lowercase variables\ncmd | read bar; echo $bar         # Assignments in subshells\ncat foo | cp bar                  # Piping to commands that don't read\nprintf '%s: %s\\n' foo             # Mismatches in printf argument count\neval \"${array[@]}\"                # Lost word boundaries in array eval\nfor i in \"${x[@]}\"; do ${x[$i]}   # Using array value as key\n```\n\n### Robustness\n\nShellCheck can make suggestions for improving the robustness of a script:\n\n```sh\nrm -rf \"$STEAMROOT/\"*            # Catastrophic rm\ntouch ./-l; ls *                 # Globs that could become options\nfind . -exec sh -c 'a \u0026\u0026 b {}' \\; # Find -exec shell injection\nprintf \"Hello $name\"             # Variables in printf format\nfor f in $(ls *.txt); do         # Iterating over ls output\nexport MYVAR=$(cmd)              # Masked exit codes\ncase $version in 2.*) :;; 2.6.*) # Shadowed case branches\n```\n\n### Portability\n\nShellCheck will warn when using features not supported by the shebang. For example, if you set the shebang to `#!/bin/sh`, ShellCheck will warn about portability issues similar to `checkbashisms`:\n\n```sh\necho {1..$n}                     # Works in ksh, but not bash/dash/sh\necho {1..10}                     # Works in ksh and bash, but not dash/sh\necho -n 42                       # Works in ksh, bash and dash, undefined in sh\nexpr match str regex             # Unportable alias for `expr str : regex`\ntrap 'exit 42' sigint            # Unportable signal spec\ncmd \u0026\u003e file                      # Unportable redirection operator\nread foo \u003c /dev/tcp/host/22      # Unportable intercepted files\nfoo-bar() { ..; }                # Undefined/unsupported function name\n[ $UID = 0 ]                     # Variable undefined in dash/sh\nlocal var=value                  # local is undefined in sh\ntime sleep 1 | sleep 5           # Undefined uses of 'time'\n```\n\n### Miscellaneous\n\nShellCheck recognizes a menagerie of other issues:\n\n```sh\nPS1='\\e[0;32m\\$\\e[0m '            # PS1 colors not in \\[..\\]\nPATH=\"$PATH:~/bin\"                # Literal tilde in $PATH\nrm “file”                         # Unicode quotes\necho \"Hello world\"                # Carriage return / DOS line endings\necho hello \\                      # Trailing spaces after \\\nvar=42 echo $var                  # Expansion of inlined environment\n!# bin/bash -x -e                 # Common shebang errors\necho $((n/180*100))               # Unnecessary loss of precision\nls *[:digit:].txt                 # Bad character class globs\nsed 's/foo/bar/' file \u003e file      # Redirecting to input\nvar2=$var2                        # Variable assigned to itself\n[ x$var = xval ]                  # Antiquated x-comparisons\nls() { ls -l \"$@\"; }              # Infinitely recursive wrapper\nalias ls='ls -l'; ls foo          # Alias used before it takes effect\nfor x; do for x; do               # Nested loop uses same variable\nwhile getopts \"a\" f; do case $f in \"b\") # Unhandled getopts flags\n```\n\n## Testimonials\n\n\u003e At first you're like \"shellcheck is awesome\" but then you're like \"wtf are we still using bash\"\n\nAlexander Tarasikov,\n[via Twitter](https://twitter.com/astarasikov/status/568825996532707330)\n\n## Ignoring issues\n\nIssues can be ignored via environmental variable, command line, individually or globally within a file:\n\n\u003chttps://github.com/koalaman/shellcheck/wiki/Ignore\u003e\n\n## Reporting bugs\n\nPlease use the GitHub issue tracker for any bugs or feature suggestions:\n\n\u003chttps://github.com/koalaman/shellcheck/issues\u003e\n\n## Contributing\n\nPlease submit patches to code or documentation as GitHub pull requests! Check\nout the [DevGuide](https://github.com/koalaman/shellcheck/wiki/DevGuide) on the\nShellCheck Wiki.\n\nContributions must be licensed under the GNU GPLv3.\nThe contributor retains the copyright.\n\n## Copyright\n\nShellCheck is licensed under the GNU General Public License, v3. A copy of this license is included in the file [LICENSE](LICENSE).\n\nCopyright 2012-2019, [Vidar 'koala_man' Holen](https://github.com/koalaman/) and contributors.\n\nHappy ShellChecking!\n\n## Other Resources\n\n* The wiki has [long form descriptions](https://github.com/koalaman/shellcheck/wiki/Checks) for each warning, e.g. [SC2221](https://github.com/koalaman/shellcheck/wiki/SC2221).\n* ShellCheck does not attempt to enforce any kind of formatting or indenting style, so also check out [shfmt](https://github.com/mvdan/sh)!\n","funding_links":[],"categories":["Haskell","HarmonyOS","Shell","\\*nix/\\*nux","Supported Linters","Applications","CLI tools","Development Environment","Linux Basics","Misc","Containers \u0026 Language Extentions \u0026 Linting","Linters","Bash","Contributions","shell","web shell、shellcode","应用","Tools","Shell script scanning","bash","Development tools","Languages:","developer-tools","Shell Script Development","Developer Utilities","Programming Languages","Analysis"],"sub_categories":["Windows Manager","Visual Studio Code","Developer","Development","Lint and Format","For JavaScript","Shell","Todo List","网络服务_其他","开发","Haskell","React Components","Console-based Applications and Tools","Other","Linters","Directory Navigation","Bash","Reusable Things"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoalaman%2Fshellcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoalaman%2Fshellcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoalaman%2Fshellcheck/lists"}