Table of Contents

What is Word Splitting (or Word expansion) in Bash ?

About

word splitting is an expansion that splits a string into words.

When passing a string to a function, the parameters will be parsed with the IFS value before being assigned.

The shell scans the results of:

that did not occur within double quotes for word splitting.

The shell treats each character of IFS as a delimiter, and splits the results of the other expansions into words on these characters.

Explicit null arguments ("" or '') are retained. Unquoted implicit null arguments, resulting from the expansion of parameters that have no values, are removed. If a parameter with no value is expanded within double quotes, a null argument results and is retained.

Note that if no expansion occurs, no splitting is performed.

IFS

Disable

If the value of IFS is null, no word splitting occurs.