Use alternate text when variable is set and non-empty.
Section: Variables
Alternate value expansion
bash
bash
echo "${DEBUG:+enabled}"Explanation
Good for optional flags and output labels.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Variables