Bash: Guides and Practical Know-how | Page 2 | mironsoft Blog
Bash
-
Apr 4, 2026
A subshell is convenient, but not free: every set of parentheses, every pipe and every command substitution spawns a new child process with its own copy of the environment. Sourcing runs the same commands in the current process, saves the fork and shares variables directly, but comes with very different side effects on script state.
-
Mar 31, 2026
helm upgrade --install is quick to type, but without lint, diff and rollout verification it stays unclear whether a deployment was actually successful. Bash automation around Helm deployments checks charts before applying them, actively waits for a healthy rollout, and automatically rolls back to the last working revision on failure.
-
Mar 30, 2026
A deploy error that cannot be reproduced is not a solved error, it is deferred chaos. set -x, trap ERR, LINENO and structured log files make every error in deploy scripts traceable, reproducible and usable as the foundation for post-mortem analyses.
-
Mar 26, 2026
Anyone adding command-line options to a Bash script quickly ends up at getopts, the Bash built-in for short options. It is available everywhere, portable, and needs no external dependency, but it does not support long options like --verbose. Anyone who needs both combines getopts with a manual case loop and builds parameter parsing that feels like a real CLI tool.
-
Mar 24, 2026
A dependency update checker regularly collects the state of outdated packages across multiple repositories and surfaces security advisories before they show up unpleasantly in an audit. This article shows how such a dependency update checker evaluates composer outdated and npm outdated with jq, classifies version jumps, and automatically ships the results as a report.
-
Mar 19, 2026
A script with #!/bin/sh runs fine on your own machine and fails on a Debian server with a cryptic error. The reason is the gap between Dash and Bash: two shells with a shared POSIX base but very different feature sets.
-
Mar 16, 2026
A nightly mysqldump usually lands unchecked in the backup directory until it's needed in an emergency and turns out to be empty or outdated. An automated database dump analysis in Bash reads size trends, table row counts, and schema changes directly from the dump file, without restoring it into a test database.
-
Mar 15, 2026
PATH hijacking exploits the fact that Bash scripts resolve commands through an inherited, potentially manipulated PATH variable instead of using fixed, trusted paths. This article shows how a manipulated PATH or IFS tricks a script into running someone else's programs, why cron jobs and systemd units are especially affected, and which concrete measures harden Bash scripts against this attack pattern.
-
Mar 14, 2026
Comparing two CSV exports, finding out what got added, what is missing and what is shared: sort, uniq and comm solve this task without a database and without an external scripting language, simply through the right combination of three classic Unix tools.
-
Mar 13, 2026
Classic wait blocks until every started background job is done, which caps parallelism at the boundaries of whole batches. wait -n instead waits for the first job to finish, whichever one it is, finally making worker pools with consistently high utilization practical, without reaching for external tools like GNU Parallel.