expansion

Bash Alternate for an assigned value

Yields the alternate word when p is set, even if empty; otherwise yields an empty string.

Formal Syntax & Structure

bash syntaxbash
${p+word}

Return Value

shell expansion result

Yields the alternate word when p is set, even if empty; otherwise yields an empty string.

Working Example

Example Snippetbash
p=printf '%s\n' "${p+supplied}"
Bash Reference