Word Splitting: The Bash Gotcha That Corrupts Filenames
Unquoted bash variables split on IFS and quietly break loops, file ops, and filenames with spaces. Here's why it happens and how to always quote right.
All the articles with the tag "scripting".
Unquoted bash variables split on IFS and quietly break loops, file ops, and filenames with spaces. Here's why it happens and how to always quote right.
Bash has built-in string operations: substring extraction, find-replace, case conversion, and trimming. You don't need sed for basic text work.
set -e looks bulletproof, but it slips right through pipes, command substitution, and conditionals. The bash gotchas that bite at 2 AM, and how to fix them.
Bash has built-in arithmetic. You don't need bc for 90% of math. Here's how to do it right.
set -euo pipefail makes your bash scripts fail fast instead of silently. Here's what each flag does and why they matter.
jq is JSON on the command line. Here are 5 one-liners that actually solve real problems: filtering, extracting, transforming, combining, and debugging.
xargs and while read both loop over input, but they handle arguments, signals, and performance differently. Here's when to use each.
Practical find command examples: -mtime, -newer, -type, -exec vs xargs, -not, size filters. The patterns you google every time.
Something's squatting on port 8080 and you need to know what. ss, netstat, and lsof one-liners to find the PID behind a port fast.
grep is more powerful than you think — regex patterns, context flags, recursive search, and piping tricks that save hours of log digging.
The Linux commands every sysadmin reaches for daily — file ops, process management, networking, and text manipulation you can't live without.
Use docker cp to move files between running containers and your host machine — no volumes needed for one-off file transfers.