Add a script for checking whether a value is truthy
This commit is contained in:
parent
c4ecd89bf6
commit
7728cf9e87
2 changed files with 13 additions and 2 deletions
scripts/Common/Scripts
10
scripts/Common/Scripts/is-truthy.sh
Normal file
10
scripts/Common/Scripts/is-truthy.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
function isTruthy() {
|
||||
local value;
|
||||
value="$1";
|
||||
|
||||
[ ! -z "$value" ] &&
|
||||
[ "$value" != "0" ] &&
|
||||
[ "$value" != "false" ] &&
|
||||
[ "$value" != "n" ] &&
|
||||
[ "$value" != "no" ];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue