Recall safe quoting and argument-boundary patterns for common shell scripting situations.
Default When should you write "$var" instead of $var? When the expanded value should stay one argument. That includes paths, URLs, tokens, customer names, and command substitutions. Leave it unquoted only for deliberate splitting or globbing. Array boundary Which command-building pattern preserves arguments? Use arrays for conditional command construction in Bash. Common objection Quoting everything breaks my glob. You need files matching .csv, but each matched path may contain spaces. Your line Quote the directory, not the glob: for f in "$dir"/.csv; do ...; done, or use find -print0 for arbitrary names. Do not unquote the whole path variable just…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in