6 ms·
The best best part of Shellcheck is that the errors it produces have a short code that can be looked up in their wiki. The wiki explains what you did, why it’s
by teeray 6y ago
The best best part of Shellcheck is that the errors it produces have a short code that can be looked up in their wiki. The wiki explains what you did, why it’s bad, and how to fix it. Using Shellcheck teaches you to write better Bash, rather than just yelling at you with inscrutable linter violations.
- TheLocehiliosan 6y agoIf you use iTerm2 (or I think this feature is available in other terminal software) you can use "Smart Selections" to transform any ShellCheck errors into links to the wiki. 1. Create a Smart Selection with the regular expression "SC\d+" 2. Add an action to "Open URL...", with the URL "https://github.com/koalaman/shellcheck/wiki/\0 https://github.com/koalaman/shellcheck/wiki/\0" (\0 will be replaced with the matched regex) 3. Now holding down the command key will change any ShellCheck errors to be active http links.
- chasil 6y agoBASH is not an appropriate standard to use in writing a script. ShellCheck recognizes three hashbangs, POSIX, BASH, and the Korn shell (as is explained in the manual page). I would argue and assert that BASH is the least relevant of the three. I have occasionally needed to write to the POSIX standard, and remove advanced features from my scripts. This is most commonly needed for BusyBox (including Windows) and Ubuntu/Debian DASH. It is important to understand what is not in POSIX, for the time when an advanced shell isn't available. Please browse the POSIX definition, reported by a google of "POSIX shell": https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V... The Korn shell lived and diverged for many years, beginning with ksh88 (issued before the first BASH release in 1989). David Korn retired, and AT&T was not pleased with ksh93 changes implemented by outsiders who impacted both compatibility and performance, and thus ksh93 was rewound. Cygwin, notibly, only implements mksh for Windows. The mksh binary on all platforms is a fraction of the size of BASH (check the output of the "size" command if an "ls" does not persuade you). However, the MirBSD Korn shell is one of the most lively shells for development activity, the latest release being in October of 2020. It is also on every Android phone (chosen as the system shell by Google), so its deployment is massive. When I am purposely writing above the POSIX shell, I choose mksh from MirBSD as my standard. I do not think the BASH innovations to be well-thought.
- joshenders 6y agoThe authors of Bash don’t capitalize Bash
- chasil 6y agoIf only they had chosen a more reasonable improvement on coprocesses, I would have used whatever case they wanted.
- abathur 6y ago> However, the MirBSD Korn shell is one of the most lively shells for development activity, the latest release being in October of 2020. https://lists.gnu.org/archive/html/info-gnu/2020-12/msg00003.html https://lists.gnu.org/archive/html/info-gnu/2020-12/msg00003...
- chasil 6y agoAs said, far more active. bash 5.0: https://www.osnews.com/story/129062/bash-5-0-released/ https://www.osnews.com/story/129062/bash-5-0-released/ 2019-01-08 MirBSD Korn 2020: Oct 31, 2020 mksh-R59c May 16, 2020 mksh-R59b Apr 14, 2020 mksh-R59 Mar 27, 2020 mksh-R58 Mar 1, 2019 mksh-R57
- abathur 6y agoAs said: > the MirBSD Korn shell is one of the most lively shells for development activity, the latest release being in October of 2020 I.e., you suggested the measure is release recency, not cadence. And after I pointed out that bash (sorry, BASH) has a more-recent release, you're moving the goalposts. Anyways. It doesn't matter. Love the shell(s) you love; hate the shell(s) you hate. You don't need a quantitative basis. They can release as often or as rarely as they like with little impact on whether they're good shells or not. Also: https://github.com/oilshell/oil/branches/all?query=release%2F https://github.com/oilshell/oil/branches/all?query=release%2...
- 6y ago
- deleted 6y ago[deleted]
- account42 6y agoThey should add the wiki URLs as links to those error codes then (if supported by the terminal) - GCC has done that recently for the -W flags shown in warning or error messages.