Checking a variable is set

Published ยท Updated 10 Feb 2020

Common:

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

More correct:

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

Actually using test is better.