Re:Use Long Options in Scripts
by apgwoz on Saturday March 22, 2025 @10:49AM
(#43446022)
You should always type check your shell scripts as well. For example, you just:
Then you can be pretty sure your script isn’t going to do unnecessary harm, and has some proper guardrails in place.
[ Parent
| on HN ]
I don't know shelltypes, and it sounds like a linter for shell scripts.
Does shelltypes warn against a failure to check for ARG_MAX?
Where does "shelltypes" come from? I can't find anything on DuckDuckGo or Google, but this seems like it would be very useful.
Re:Use Long Options in Scripts
by Arrowmaster on Saturday March 22, 2025 @12:40PM
(#43446945)
From the output in the post I'm going to assume it's either a joke post or an LLM hallucination.
Oh god, it even says right there:
> Warning: this utility is fake.
Well played! I guess I got too excited at the possibility of such a tool existing.
Such a tool does exist, it's called shellcheck. If you give /bin/sh shebang for example it will tell you off using non-POSIX features regardless of whether they'll work with the sh on your system.
(Personally I typically use bash though, largely so I can `set -eEuo pipefail` next.)