Word Splitting: The Bash Gotcha That Corrupts Filenames
Unquoted variables split on IFS, breaking loops and file operations. Always quote vars. Here's why.
All the articles with the tag "bash".
Unquoted variables split on IFS, breaking loops and file operations. Always quote vars. Here's why.
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 silently fails in subshells, pipes, and conditionals. Learn the gotchas and 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.
awk is perfect for parsing logs. Here are 5 patterns that handle filtering, summing, counting, splitting fields, and pretty-printing without reaching for Perl or Python.
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.
Navigate /etc/environment, ~/.bashrc, ~/.profile, and systemd Environment=. When to use each.
PATH is different in cron, stdout is muted, and MAILTO breaks silently. Learn cron traps and how to debug them.
Practical find command examples: -mtime, -newer, -type, -exec vs xargs, -not, size filters. The patterns you google every time.
Signals explained: SIGTERM vs SIGKILL, graceful shutdown, and when to actually use kill -9.