Checking a variable is set

Published: Wednesday, Dec 26, 2007 Last modified: Monday, Apr 8, 2024

Common:

[[ $FILES ]] || echo "No files!"; break

More correct:

[[ ${var+set} ]] && echo set || echo unset

Actually using test is better.