Skip to content

Instantly share code, notes, and snippets.

@mateor
Forked from ELLIOTTCABLE/gist:3a945b04ed8170d710ac
Last active August 29, 2015 14:18
Show Gist options
  • Save mateor/38bd90c459a5e7667e34 to your computer and use it in GitHub Desktop.
Save mateor/38bd90c459a5e7667e34 to your computer and use it in GitHub Desktop.
[ -n "${VAR##[NFnf]*}" ] && echo '$VAR must be truthy (but will be considered falsey by default, if empty)'
[ -z "${VAR##[YTyt]*}" ] && echo '$VAR must be truthy (and will be by default, if empty)'
[ -z "${VAR##[NFnf]*}" ] && echo '$VAR must be falsey (and will be by default, if empty)'
[ -n "${VAR##[YTyt]*}" ] && echo '$VAR must be falsey (but will be considered truthy by default, if empty)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment