Hacker News with Generative AI: Shell Scripting

A Second Search for Bash Scripting Alternatives (monzool.net)
SHELL SCRIPTING IS something most programmers will encounter often – especially if doing dev-ops, automation and general Linux work. Unfortunately we are mostly stuck with bash. There surely must be better alternatives…
Resolving a mysterious problem with find (johndcook.com)
Suppose you want to write a shell script searches the current directory for files that have a keyword in the name of the file or in its contents. Here’s a first attempt.
Yosild: A single shell script that builds a full, minimal Linux distribution (jm.iq.pl)
Yosild is a single shell script that builds a full, minimal Linux distribution, based on BusyBox. It compiles the latest stable kernel and the latest stable version of the BusyBox. This script can prepare minimalistic Linux system for devices with little hardware resources. Yosild Linux needs just 70 MB RAM and 40 MB storage size. yosild.sh requires minimal Debian or Ubuntu distro to run with the architecture compatible with the target device.
Learn Awk in Y Minutes (learnxinyminutes.com)
AWK is a standard tool on every POSIX-compliant UNIX system. It’s like flex/lex, from the command-line, perfect for text-processing tasks and other scripting needs. It has a C-like syntax, but without mandatory semicolons (although, you should use them anyway, because they are required when you’re writing one-liners, something AWK excels at), manual memory management, or static typing. It excels at text processing. You can call to it from a shell script, or you can use it as a stand-alone scripting language.
85% of Cursor AI in a Shell Script and Good Prompting (rohan.ga)
This is an example workflow of how to integrate LLMs into your software dev.
NGS – Next Generation Shell (ngs-lang.org)
Next Generation Shell is a modern programming language that focuses on "DevOps"y use cases.
Abuse ZSH Parameter Expansion to Expand GNU-Style Arguments (blogspot.com)
This method offers exactly one benefit: the target platform I was working with for this project was mingw under Windows and, like WSL1, it had this very painful performance issue when a shell had to create a sub-shell -- basically, any time you $(run something) and that means "if your function returns anything except for an integer", it's going to have a serious cost to place that into a variable the convenient way.
Whence '\n'? (rodarmor.com)
If you do just foo, the following justfile will write a single byte 0x0A to a file named bar:
A Tour of Hell – Shell scripting Haskell dialect (chrisdone.com)
This set of slides sketches out the implementation of Hell, in technical detail. I do tend to switch between the slides, old code, and the present code, so bear with me. It's more about the ideas. If you want to see a complete implementation, the complete implementation of Hell is one file, which you can look through easily.
What was the point of [ "x$var" = "xval" ]? (2021) (vidarholen.net)
In shell scripting you sometimes come across comparisons where each value is prefixed with "x". Here are some examples from GitHub:
OpenBSD now enforcing no invalid NUL characters in shell scripts (undeadly.org)
The Dune Shell (adam-mcdaniel.github.io)
Dune is a shell designed for powerful scripting. Think of it as an unholy combination of bash and Lisp.
Techniques I use to create a great user experience for shell scripts (nochlin.com)
"You should go and check out the shell script in the repo because it's very nice. It has colored output, it's super safe... it's really a masterclass in terms of writing shell scripts."
Show HN: Awk Version Comparison Dashboard (megamansec.github.io)
Show HN: Ward – a file vault written in bash (github.com/oeo)
The Queueing Shell Game (danslimmon.com)
Show HN: A shell script to search multiple torrent sites from CLI (github.com/TUVIMEN)
Tmpmail: Temporary email right from your terminal written in POSIX sh (github.com/sdushantha)
Show HN: Autocomplete.sh <Tab> in the shell to trigger LLM based bash_complete (autocomplete.sh)
Syscall.sh (syscall.sh)
Show HN: Llm2sh – Translate plain-language requests into shell commands (github.com/randombk)
Bash's $PS0 (2016) (dnsalias.org)
Show HN: Sandcastle – a minimal, lightweight build tool and shell automator (github.com/sam-the-programmer)
Why not parse `ls` and what to do instead (stackexchange.com)
Ruby: A great language for shell scripts (lucasoshiro.github.io)
Advanced Shell Scripting Techniques: Automating Complex Tasks with Bash (omid.dev)
Why you shouldn't parse the output of ls(1) (wooledge.org)
Common Lisp for shell scripting (2021) (simonsafar.com)
Posix Shell Tutorial (2023) (grymoire.com)
Lila: A Lil Interpreter in Posix Awk (beyondloom.com)