this post was submitted on 10 May 2025
12 points (100.0% liked)
Shell Scripting
1442 readers
3 users here now
From Ash, Bash and Csh to Xonsh, Ysh and Zsh; all shell languages are welcome here!
Rules:
- Follow Lemmy rules!
- Posts must relate to shell scripting. (See bottom of sidebar for more information.)
- Only make helpful replies to questions. This is not the place for low effort joke answers.
- No discussion about piracy or hacking.
- If you find a solution to your problem by other means, please take your time to write down the steps you used to solve your problem in the original post. You can potentially help others having the same problem!
- These rules will change as the community grows.
Keep posts about shell scripting! Here are some guidelines to help:
- Allowed: Release Announcement of a command-line program designed for scripted use (e.g. bash, bats, awk, jq, coreutils/moreutils)
- Allowed: Tutorials on using shell languages or supplementary tools designed for scripted use
- Allowed: Code review/help requests for shell languages or supplementary tools designed for scripted use
- NOT Allowed: Announcement of a CLI or TUI program that is not designed for scripted use (Yes, your fancy Zsh plugin which pretty-prints the date and time using only builtins is very cool, but unless you actually want to discuss the code itself, please check out !commandline instead!)
- NOT Allowed: Domain-specific tutorials that do not involve shell scripting as a core component (e.g. docker-compose, ansible, nix). If you really love one of these, I'm sure there's a community out there ready to talk about them!
- NOT Allowed: Code review requests for non-shell programming languages and configuration languages (e.g. Python, Yaml)
In general, if your submission text is primarily shell code, then it is welcome here!
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You linked a tutorial to sh. Note that nobody ends up shell scripting in sh. People will use bash, which is an alternative shell and shell language, and almost universally available where sh is available. sh is very old and limited. bash is much more common.
There's many other kinds of shells as well though. And you such an automation task you could use any number of scripting languages. The part that makes it a shell, which is interactive use, is not necessary for a scripting task like this of automating an operation. Shell languages can be used as scripting languages too though. I just want to point out alternatives and context.
Personally, I use Nushell as my daily shell and for scripts and am very satisfied with it. It's not universally available as in pre-installed, but is multi-platform and easy to install through an exe or package. Because it's a newer project, there's not that many resources yet, and still occasionally makes changes to its language with new releases. But, for me, the upsides to other shells are obvious and significant. I posted my Nushell solution in a separate comment (separating concise solution from this general prose exploration).