Print variable preserving spaces.
Section: Variables and Expansion
Quote variable safely
bash
bash
printf '%s
' "$name"Explanation
Double-quote variable expansions unless you intentionally want word splitting.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Variables and Expansion