Bash: Guides and Practical Know-how | Page 5 | mironsoft Blog
Bash
-
Jan 6, 2026
A release script without a dry run mode is a blind flight into production. With checkpoint flags, --dry-run, rollback logic, and a complete step-by-step log, you get release scripts you can test beforehand, abort on failure, and resume after interruptions.
-
Jan 4, 2026
Bash loads a different combination of configuration files on every start, depending on whether it runs as a login shell, an interactive non-login shell, or a non-interactive script execution. Anyone who writes PATH extensions or environment variables into the wrong file gets a locally working setup and later wonders why that exact same variable is suddenly missing in a cron job or deployment script.
-
Jan 2, 2026
curl is the Swiss army knife for HTTP from the shell. Anyone who knows the right flags, parses JSON responses precisely with jq, handles authentication securely, and implements retry logic with exponential backoff can automate REST APIs directly in Bash, without external frameworks.
-
Dec 28, 2025
Tabular data shows up in almost every automation task: export files, reports, configuration, migration sources. With the right tools, awk for column operations, read with IFS for line-based processing, mapfile for in-memory work, CSV and TSV files can be processed reliably in Bash without external dependencies.
-
Dec 28, 2025
A spinner shows that a script is active even when the duration of a step is unknown and no percentage can be calculated. This article shows how a spinner animation emerges as a background process in Bash, how it is synchronized cleanly with a running command, and how trap ensures no spinner process is left orphaned.
-
Dec 25, 2025
Shell scripts are rarely tested, and that is exactly why they fail without warning in production. ShellCheck finds static errors before the script ever runs. The BATS framework enables real unit tests for Bash functions. Mocking strategies isolate external commands. CI integration ensures that every commit meets this standard.
-
Dec 25, 2025
Calling a script POSIX compliant is quick to claim and rarely verified. This checklist provides concrete steps, tools and a test matrix to systematically secure an existing script against Dash, BusyBox ash and other lean shells.
-
Dec 20, 2025
Anyone working with multiple Kubernetes clusters every day types the same kubectl commands hundreds of times and risks accidentally deleting something in the wrong namespace. A well designed kubectl wrapper in Bash shortens recurring commands, adds safety nets for production namespaces, and handles pod selection through a fuzzy finder instead of copying pod names by hand.
-
Dec 20, 2025
Anyone managing backups, configuration files, and API secrets from the shell eventually runs into OpenSSL and GPG. This article shows how to use both tools safely and practically in Bash scripts, from symmetric encryption through GPG signing to automated certificate checks without any interactive password prompts.
-
Dec 20, 2025
Raw ANSI escape codes like \e[31m look fine in your own terminal, but break the moment a script runs on a different terminal type or its output gets redirected into a log file. tput instead queries the current terminal's actual capabilities and returns the matching escape sequence, while a simple isatty check makes color vanish automatically once nobody is reading it interactively anymore.