Koskamo

Quoting and word splitting

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

Quoting removes the special meaning of certain characters or words to the shell: it can disable special treatment for special characters, prevent reserved words from being recognized as such, and prevent parameter expansion. Bash has four quoting mechanisms — the escape character, single quotes, double quotes, and dollar-single quotes. Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, , \, and, when history expansion is enabled, !; in POSIX mode ! has no special meaning within double quotes even when history expansion is enabled. Within double quotes a backslash retains its special meaning only when followed by $, , ", \, or newline, and backslashes before those characters are removed; backslashes preceding characters without a special meaning are left unmodified. The special parameters * and @ have special meaning when in double quotes. Double-quoting expansions whose results should not be word-split or filename-expanded is Koskamo editorial guidance. Scope: Bash. Reviewed October 4, 2026.

Source and provenance

Original source
www.gnu.org
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.