ShellCheck
shellharden
Our great sponsors
ShellCheck | shellharden | |
---|---|---|
286 | 15 | |
28,775 | 4,218 | |
- | - | |
7.9 | 7.2 | |
4 days ago | 2 months ago | |
Haskell | Rust | |
GNU General Public License v3.0 or later | Mozilla Public License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ShellCheck
-
Variables in Bash Script
ShellCheck warns about this and other common problems
-
Can't figure out how to accept user input to break out of while loop
This, plus [shellcheck](https://www.shellcheck.net/) or something similar should help you figure out most problems a LOT faster.
-
I can't for the life of me figure out the weird syntax!
shellcheck is quite nice to check your syntax for mistakes, even ones that don't usually cause issues but perhaps on files with spaces in their names, etc.
-
i was watching a tutorial of learning bash but came across this error. can anyone help?
Final suggestion, run your script through https://www.shellcheck.net/ to get suggestions on improvements.
-
Choosing an improved terminal/shell and need help
A tool like shellcheck can help quite a bit in navigating bash requirements: https://github.com/koalaman/shellcheck I'd suggest using Zsh interactively (w/ syntax highlighting, autocompletion, easy to use hook functions, etc.); & stick to bash with shellcheck analysis for scripting generally.
-
AWK return/print as nested array in Bash
So you probably want two nested while loops as you count down or up the array. These examples should fix you up. I recommend the vanilla POSIX while example, and install the command-line version of shellcheck to lint your code as you go along.
-
Why does this command always output "bar"
Note, also: https://github.com/koalaman/shellcheck/wiki/SC2015
- My code isn’t working as expected, would like some help
-
Bash script to generate patched APK
shellcheck should have caught the above, so the best tip of this lot is probably to introduce you to shellcheck if you weren’t aware of it. It’s not always right, but it’s caught a lot of bugs that I would have otherwise committed.
- Bash-ohjelmoinnin (Unix) opiskelu itsenäisesti
shellharden
-
similar to shellcheck?
Also worth mentioning shellharden
-
Bash Pitfalls
See also:
* https://www.shellcheck.net/ — linting tool to avoid common mistakes and improve your script
* Bash Practices: https://mywiki.wooledge.org/BashGuide/Practices
* Bash Pitfalls: https://mywiki.wooledge.org/BashPitfalls
* safe ways to do things in bash: https://github.com/anordal/shellharden/blob/master/how_to_do...
* better scripting: https://robertmuth.blogspot.in/2012/08/better-bash-scripting...
* robust scripting: https://www.davidpashley.com/articles/writing-robust-shell-s...
-
Code formatter, linters, etc. Recommendations?
There is shellcheck, and shellharden which is a strict version of it. There are similar stuff here, some that also help with your editor. You can also use a docker version of shfmt. See here for a quick tutorial on shfmt.
-
What is best Method of Submitting Bash Script, short Python ignorance confession (lament.)
Regarding linters, there are several of them in most languages.For bash, there is Shellcheck or a more strict (and sometimes confusing) Shellharden to do exactly what you want.
-
Awesome Rewrite It In Rust - A curated list of replacements for existing software written in Rust
For example, shellharden looks awesome.
- anordal/shellharden Safe ways to do things in bash
- How to do things safely in Bash
- How to do things safely in Bash (2018)
What are some alternatives?
bash-language-server - A language server for Bash
efm-langserver - General purpose Language Server
PowerShell - PowerShell for every system!
neomake - Asynchronous linting and make framework for Neovim/Vim
sh - A shell parser, formatter, and interpreter with bash support; includes shfmt
shfmt - Dockernized shfmt. This formats shell script.
proot - An chroot-like implementation using ptrace.
ohmyzsh - 🙃 A delightful community-driven (with 2,000+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
stan - 🕵️ Haskell STatic ANalyser
babashka - Native, fast starting Clojure interpreter for scripting
maam - A monadic approach to static analysis following the methodology of AAM