shopt-option

Bash nullglob

Removes unmatched glob patterns instead of retaining the literal word.

Formal Syntax & Structure

bash syntaxbash
shopt -s nullglob

Return Value

shell behavior

Removes unmatched glob patterns instead of retaining the literal word.

Working Example

Example Snippetbash
shopt -s nullglobset -- *.missingprintf '%s\n' "$#"
Bash Reference