HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
koalaman
shellcheck
Haskell2013–2025
koalaman / shellcheck

shellcheck

ShellCheck, a static analysis tool for shell scripts

92Distinct people
100Mentions
5Explicit recommenders
40.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

ShellCheck, a static analysis tool for shell scripts

GitHub

Where it is used

  • GitLab — GitLab uses ShellCheck to lint its shell scripts. It also prescribes a GitLab CI/CD job configuration to run it across projects. Source
  • ShellCheck for Visual Studio Code — ShellCheck for Visual Studio Code bundles the ShellCheck tool and uses it to lint shell scripts, showing ShellCheck warnings in the editor and the Problems view. Source

What people are saying

One of my favorite things about Shellcheck is that the error messages come with a link to a wiki page about the problem. Does anyone know other programs that have a similar…

ufo used a recommendation phrase. 5 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 11:34:28 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year100 dated mentions

Observed mentions: 2013-11-18 12:25:12 UTC to 2025-12-30 22:10:57 UTC.

0510152013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 6 mentions; 2 submissions, 4 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 8 mentions; 2 submissions, 6 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 9 mentions; 2 submissions, 7 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 10 mentions; 1 submissions, 9 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 13 mentions; 1 submissions, 12 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 13 mentions; 2 submissions, 11 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 15 mentions; 2 submissions, 13 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 9 mentions; 0 submissions, 9 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC202
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC624
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC211
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC826
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC927
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC1019
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC615
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC13112
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC13211
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC15213
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC909
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC404
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC312

What Hacker News says

13 sources
PostgREST is written in Haskell and quite popular: https://postgrest.org/en/v7.0.0/ Shellcheck has become a very important tool to many people writing shell scripts: https://github.com/koalaman/shellcheck GitHub's semantic analysis is written in Haskell: https://github.com/github/semantic I'm not sure why Pandoc doesn't count. I think it is definitely the case that most examples of successful Haskell are technical programs of interest to hackers. I don't think that's much of a problem myself.
In New Haskell Foundation to Foster Haskell Adoption, Raises 200k USD
I use Sublime Text 3 for nearly all my DevOps work. I figured that I'd give Nova a try as I was a big Coda fan back in the day. I opened up Nova and first installed HCL (language support for HashiCorp's Terraform and Packer). Then I looked for Shellcheck[1] validator, but was disappointed it did not exist. Then I search for Kubernetes and Helm wondering if there were any specific extensions, but no results. Next up was installing Dockerfile and ENV syntax highlighting. Overall still tinkering around, but Nova seems very promising. [1] https://github.com/koalaman/shellcheck
In Nova by Panic
Here's my full bash reading list: - ShellCheck: life-changing BASH linter and testing toolkit https://github.com/koalaman/shellcheck - 30 interesting commands for the Linux shell – Víctor López Ferrando https://www.lopezferrando.com/30-interesting-shell-commands/ - 7 Surprising Bash Variables https://zwischenzugs.com/2019/05/11/seven-surprising-bash-va... - anordal/shellharden https://github.com/anordal/shellharden/blob/master/how_to_do... - barryclark/bashstrap https://github.com/barryclark/bashstrap - BashPitfalls : Greg's Wiki http://mywiki.wooledge.org/BashPitfalls - Common shell script mistakes
Read the rest
http://www.pixelbeat.org/programming/shell_script_mistakes.h... - Comparison of all the UNIX shells http://hyperpolyglot.org/unix-shells - Defensive Bash Programming https://www.kfirlavi.com/blog/2012/11/14/defensive-bash-prog... or https://jonlabelle.com/snippets/view/markdown/defensive-bash... - Bash FAQ and Cookbook https://mywiki.wooledge.org/BashFAQ - Detecting the use of "curl | bash" server side https://idontplaydarts.com/2016/04/detecting-curl-pipe-bash-... - Gensokyo Blog - Use Bash Builtins shell,fish,bash https://blog.gensokyo.io/a/fafbe742.html - Rich’s sh (POSIX shell) tricks http://www.etalabs.net/sh_tricks.html - Shell Scripts Matter https://dev.to/thiht/shell-scripts-matter - Shell Style Guide https://google.github.io/styleguide/shell.xml - Shellcode Injection - Dhaval Kapil https://dhavalkapil.com/blogs/Shellcode-Injection/ - Something you didn't know about functions in bash http://catonmat.net/blog/bash-functions - Ten More Things I Wish I’d Known About bash https://zwischenzugs.com/2018/01/21/ten-more-things-i-wish-i... - Ten Things I Wish I’d Known About bash https://zwischenzugs.com/2018/01/06/ten-things-i-wish-id-kno... - Testing Bash scripts with BATS https://opensource.com/article/19/2/testing-bash-bats - Testing Bash scripts with Critic.sh https://github.com/Checksum/critic.sh - Useful BASH and UNIX commands https://cb.vu/unixtoolbox.xhtml - When Bash Scripts Bite :: Jane Street Tech Blogs https://blogs.janestreet.com/when-bash-scripts-bite/ - Bashible: Ansible-like framework for bash-based devops https://github.com/mig1984/bashible - Auto-parse help text from comment at the top of script https://samizdat.dev/help-message-for-shell-scripts/ - Make bash scripts safer by writing them in Rust https://github.com/rust-shell-script/rust_cmd_lib - Additional shell options for non-trivial bash scripts https://saveriomiroddi.github.io/Additional-shell-options-fo...
In Bash Pitfalls
First, we shouldn't be insulting people for having different opinions on the nuances of command line tools. Secondly, I agree with you that "useless use of x" should not be viewed as dogma and people shouldn't stress too much about it. Instead, these can be viewed as optimizations, or just details regarding how unix shells and tools work that can help inform your coding. IMO, the best thing to do when writing shell scripts, regardless of skill level, is configure ShellCheck in your text editor's linter, and then do everything it tells you to do: https://github.com/koalaman/shellcheck/
In Useless Use of Cat Award (2000)
> There are plenty of cases where `jq` will or will not be available. Sure. The argument is that it's a lot easier for the user of the program to read an error message that says "jq is required. Run apt-get install jq or homebrew install jq" than to fuck around with the python or ruby ecosystem, especially if they don't work in those languages. > Finally there are differences in how `/bin/sh` will interpret things (which there shouldn't be) depending upon underlying shell is running ksh, zsh, bash, dash Do you have an example of code that is written to the POSIX standard of shell that runs differently? I only write POSIX shell, and use https://github.com/koalaman/shellcheck to verify that to prevent that exact thing.
In Hypermodern Python
ShellCheck's unique error/warning codes and wiki descriptions for every code with the explanations and example are the work of genius. It seems so "obvious" in hindsight but not many other tools are so good. Also, tangentially, this is also so perfect: https://github.com/koalaman/shellcheck/wiki/SC2154 and, unless somebody proves otherwise, makes me believe that with ShellCheck and using the described conventions a shell script could be better diagnosed for mistyped variables than a Python script can (namely at "compile time" and not during the run). Vidar, your work significantly improved the life of people confronted with shell scripts. Thanks!
In Lessons learned from writing ShellCheck

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.