this post was submitted on 10 Jul 2025
47 points (96.1% liked)
Linux
56374 readers
633 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
If you want to do a Bash like management and programming, that is not dramatically different but fixes some irritations, then Fish is an alternative. Obviously it will not fix all issues, but there is no paradigm shift in handling streams. nushell is dramatically different and at that point, I would rather use a programming language to do the stuff. Speaking of programming language, there is also Xonsh (basically Python+Bash like combination as a system shell).
All these alternatives have a singular big flaw to me: they are not the standard tools on the system, which defeats the purpose of a system shell to me. In the end, without changing the core system that these shells are built on, I don't think its possible to make a really well made language that interoperates on system level like a shell does at the moment.
That's the reason why I got a bit more into Bash to understand some flaws, to understand how to use regexes inside Bash and variable substitutions and a few other concepts that are very useful to know. But man... there are so many traps... like looping over a wildcard for files (such as
for file in *.txt
) and if the wildcard does not match, then the loop consists of the wildcard as a literal word as if "*.txt
" was a filename. What a stupid idea. There is an option to change that, but that's the issue. The language is filled with traps and optional options and you have to know all of them.Edit: Added example code why default behavior sucks:
If you're trying to avoid a lot of those traps,
shellcheck
is pretty cool. I have written my fair share of bash and yet still get caught off-guard by its warnings - and it's right most of the time!Yes, I use shellcheck in the editor. Its pretty useful. But running (a little bit more complex commands) in the terminal directly won't help with shellcheck. That's why I also have a functionality to directly load and edit the current command in the terminal in (Neo)vim and edit and when closing Vim the command gets executed. The benefit doing this is getting checked by shellcheck in the editor and also it makes it easier to one-off complex commands.
Thanks to shellcheck I got in the habbit to always enclose variables in
${var}
. And recently learned from a community member that using[[ expr ]]
style has basically no downsides against using[ expr ]
directly.