Bash: Guides and Practical Know-how | Page 14 | mironsoft Blog
Bash
-
Apr 13, 2025
Anyone who spends many hours in the terminal every day feels every small friction immediately: slow prompts, missing autocompletion, unreadable colors, or long commands typed over and over again. Thoughtful terminal customization with a suitable shell, an informative prompt, sensible aliases and a well configured terminal emulator does not save seconds, it saves hours spread across a working week.
-
Apr 10, 2025
Shell-Skripte ohne Tests sind eine Blackbox in der Automatisierung. Das Bash Automated Testing System (BATS) bringt strukturierte Unit-Tests, Fixtures und Mocking in die Shell-Welt – und lässt sich nahtlos in GitHub Actions, GitLab CI und Jenkins integrieren, ohne externe Laufzeitabhängigkeiten.
-
Apr 9, 2025
A homegrown CLI tool only truly feels finished once the Tab key suggests subcommands, options and arguments, just like git or docker do. The Bash builtin complete together with compgen makes that possible without any external dependencies, from a simple word list up to suggestions loaded dynamically from a database or an API.
-
Apr 1, 2025
A fixed path like /tmp/script.tmp in a shell script is an open invitation for race conditions, data leaks, and symlink attacks. mktemp guarantees unique, safe temporary files, and trap EXIT ensures they get cleaned up in every termination scenario.
-
Mar 29, 2025
When a hundred servers start the same backup job at exactly 00:00, the shared database or the shared storage backend collapses under the load spike, even though each individual job would be harmless on its own. Deliberate scheduling jitter spreads out such start times randomly across a time window and prevents exactly this thundering herd effect. This article shows how jitter is applied in cron and systemd timers.
-
Mar 28, 2025
The most frustrating pattern in CI/CD practice: a Bash script runs flawlessly locally and fails in the pipeline with a cryptic error. The cause is rarely a bug in the script itself. It is a difference in the execution environment. PATH, login shells, missing environment variables, different Bash versions, and Docker container differences are the systematic traps that break Bash in CI/CD.
-
Mar 21, 2025
inotify is a kernel interface that notifies Bash scripts the instant a file or directory changes, instead of checking again and again in a loop. With the command line tool inotifywait from the inotify-tools package, you can build deployment triggers, config reloads and log watchers that react to real events rather than a fixed time interval.
-
Mar 15, 2025
Rewriting the same Bash functions for logging, retry logic and notifications in every repository creates maintenance overhead a single, shared library file avoids. Built, versioned and tested properly, such a Bash library becomes the stable foundation for every CI pipeline on a team, instead of the next source of copy-paste bugs.
-
Mar 9, 2025
Bash's built-in globbing can do far more than the simple asterisk pattern in most beginner scripts: shopt -s extglob unlocks extended patterns like alternation and negation, globstar enables recursive ** matching across whole directory trees, and nullglob prevents the classic bug where a pattern with no match gets passed through literally as a filename.
-
Mar 8, 2025
Without shared rules, shell codebases end up where every script follows a different style, error handling is missing or inconsistent, and nobody knows which checks are mandatory in review. A review checklist, clear style rules, EditorConfig and ShellCheck as a CI gate lay the groundwork so teams can review shell scripts without debating every pull request from first principles.