#ShellCheck

2025-06-07

Your periodic reminder that Shellcheck is awesome and should be used everywhere...

#ShellCheck

David Cantrell 🏏DrHyde@fosstodon.org
2025-06-03

Holy crap! That 50 line #ShellScript, which includes child process management and signal handling, not only works, but #shellcheck only whines about two things, both of which I know don't matter.

Philipp :emacs: :nixos:pmidden@fosstodon.org
2025-05-16

I'm using #shellcheck's excellent #haskell GitHub workflow to produce statically linked Haskell binaries. It's curious, however, that ghc-9.0.4 produces a binary that's roughly 1MiB in size, whereas 9.4 produces a whopping 30MiB binary. Haven't tested the later ghc versions yet, but I hope they're a bit more conservative w.r.t. size...

Ole-Morten 🚀👨‍🚀🌻olemd
2025-03-24

Finally had a reason to figure out what shellcheck means with "prefer mapfile…" shellcheck.net/wiki/SC2207

Also, shellcheck.net/wiki/SC2068, quote array expansion.

Yes, I need to read a file to an array, each line may contain spaces, and I need to pass each line as an argument to another thing.

mapfile -t lines < inputfile
dostuff "${lines[@]}"

actually does what I need, without a BUNCH of headaches.

It only took me a bit more than a quarter of a century before I got here 🙂

Schenkl | 🏳️‍🌈🦄schenklklopfer@chaos.social
2025-02-10

Lifegoal unlocked!

Ein Shellscript für eine Installationsroutine geschrieben, #shellcheck ausgeführt und auf Anhieb dort keine Fehler oder Notizen ausgelöst \o/

@inlovewithpda #bash is great, I've developed many a helping monster script. But bash also is a beast when it comes to getting it right. It's helpful to use a #Linter (like #shellcheck for example).
Even more important is to know when you should drop your bash script, consider it a prototype and reimplement it with a language that suits the problem better.

2024-12-08

Ran #shellcheck on my thesis's #Bash part and it detected like 6 errors. Some were false positives, but one was an actual problem. I was saving the passed arguments and needed to save them and temporarily remove all of them so that a sourced script doesn't exec them and it turns out that arrays in Bash are even more cursed than I thought.
I don't think I'm ever going to write shell scripts without shellcheck. Honestly it should be installed by default on every non-minimal #Linux distro.

edit: To clarify, the false positives were also things to be mindful of, specifically sourcing unknown command outputs, but it was search paths from guix, so it was fine in this very specific case.

Stephandurchaus
2024-11-20

Just a quick reminder: if you're writing scripts, always use . It'll make your life so much easier! shellcheck.net/

Peter Kreftingnafmo@vivaldi.net
2024-11-19

@klausman @nixCraft Applied a couple of minor fixes. It now at least passes #ShellCheck without complaints, which is good.

you shell not pass #ironèmes #lotr #shellcheck

Matthew Martinmistersql
2024-08-28

Me experimenting with build scripts for bash, using
- - formatting
- - linting
- bats - unit testing
- - for google style docstrings
- source - library importing
- - basic logging
- TODO: - library packaging

github.com/matthewdeanmartin/i

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst