str_replace() in Bash: Replace Text in a String
Replace text in a Bash string without sed: ${s//search/replace}, anchored replacements, why you must quote the search, and what Bash 5.2 did to &.
Archive
Replace text in a Bash string without sed: ${s//search/replace}, anchored replacements, why you must quote the search, and what Bash 5.2 did to &.
One missing slash nests a directory. One empty source wipes a backup. Tested rsync recipes for mirroring, filtering, verifying and copying over SSH.
PHP-style trim(), ltrim() and rtrim() in pure Bash with parameter expansion, plus why the popular read trick quietly removes your backslashes.
Not first match, not longest match, but a mix of both. A test config where every location names itself shows exactly how nginx picks one, and where it surprises.
Why I convert os.system() calls to subprocess.run(): no shell injection, real exit codes, captured output, timeouts and input, with notes for Python 3.6.
try_files checks files in order and only the last argument redirects. Static clean URLs, a PHP front controller with php-fpm, and the upload exploit it prevents.
Why a volume shows the image's files and a bind mount hides them, and how a root container leaves files your own user cannot edit or delete. Four tested fixes.
Cron loses output, overlaps jobs and skips runs while the machine is off. systemd timers fix all three. A tested walk-through with OnCalendar examples.
The same 147 kB binary in a 257 MB image or an 8.44 MB one. Multi-stage builds, named stages, a --target debug image, and why build secrets still leak.
?->, ?? and ??= all deal with null, but they solve different problems. Tested examples of each, short-circuiting, and the places where ?-> is not allowed.