Bash: Guides and Practical Know-how | Page 6 | mironsoft Blog
Bash
-
Dec 18, 2025
When a shell script is terminated by Ctrl+C, kill or an error, lockfiles, temporary files and half-finished database operations are left behind unless signal handling is in place. The Bash builtin trap registers handlers for SIGINT, SIGTERM, SIGPIPE, ERR and EXIT, turning cleanup into a reliable, orderly process.
-
Dec 7, 2025
A Bash script that runs cleanly on your own machine can fail on the target system because it runs a different coreutils version, is missing a tool, or ships a different Bash version. Docker test containers make these differences reproducibly visible and can be reused across the CI pipeline instead of being rebuilt from scratch on every run.
-
Dec 3, 2025
Not every team has Grafana or an ELK stack available when they need to know fast how many errors a service is producing right now. A Bash terminal dashboard built from watch, tput, and ANSI color codes shows error rates, request rates, and log levels live, right inside the SSH session, without a browser and without additional infrastructure.
-
Dec 2, 2025
Bash scripts that work correctly in a terminal often fail in pipes, as a cron job, or inside CI environments. The cause lies in how stdin, stdout, and interactive tools behave differently depending on context. /dev/null, /dev/tty, isatty detection, and non-interactive mode are the tools that make scripts work reliably in every context.
-
Dec 1, 2025
Anyone who only uses sed line by line with s/old/new/ quickly hits a wall with config blocks, XML fragments and multiline log entries. Hold space and pattern space give sed the ability to look at several lines at once and replace them as one connected block, without ever reaching for Perl or Python.
-
Nov 29, 2025
nohup ignores the SIGHUP signal, disown removes a job from the shell's job table after the fact, and setsid starts a brand-new session with no controlling terminal at all. Knowing the difference means picking the right, most robust tool for every background service in a deployment script.
-
Nov 22, 2025
Anyone who only checks DNS records one at a time by hand misses propagation problems and silent changes. Automating DNS lookups with dig and host processes domain lists in seconds, compares resolvers, and catches configuration mistakes before customers report them.
-
Nov 22, 2025
aws s3 sync transfers only changed files between a local directory and an S3 bucket, making it the standard tool for deployment and backup scripts in Bash. Used correctly it saves time and bandwidth. Used carelessly, the --delete flag can wipe out entire bucket contents in seconds. This article shows the patterns that make the difference.
-
Nov 20, 2025
Using SSH correctly in automation scripts is trickier than it looks: disabling StrictHostKeyChecking solves the first connection problem, but it opens the door to man in the middle attacks. This article shows how SSH automation works without compromising security.
-
Nov 15, 2025
Plenty of legacy tools and simple configuration files still use the INI format today: sections in square brackets, key-value pairs underneath. Bash ships with enough built-ins to read such a format reliably, as long as comments, whitespace, and quoting pitfalls are planned for from the start instead of patched in afterward.