Is In
- isin
- Arguments:
$1- Value to search for[
$2…] - Values of array to search over
- Output:
Exit code is
0for found,1for not found
Bash CLI version of isin
See also
- isin
- Arguments:
$1- Value to search for[
$2…] - Values of array to search over
- Output:
Returns
0for found,1for not found
Checks if a value is in an array
Example
isin 33 11 22 33 44
# $? is 0
isin 0 2 2 2
# $? is 1