word splitting

The step where bash cuts the result of an unquoted expansion into separate words at spaces, tabs and newlines.

An unquoted variable holding a file name with spaces can make commands such as rm act on the wrong files.

In more detail

It is why rm $f, with f set to my notes.txt, tries to delete two files named my and notes.txt. The characters it cuts at come from IFS. Double quotes around the expansion switch it off, which is why nearly every expansion should be quoted.

Related terms

Taught in

References