In Is In

inisin
Arguments:
  • $1 - Value to search for

  • [$2…] - Values of array to search over

Output:

Exit code is 0 for found, 1 for not found

Bash CLI version of inisin

See also

inisin

inisin
Arguments:
  • $1 - Value to search for

  • [$2…] - Values of array to search over

Output:

Returns 0 for found, 1 for not found

Checks if any string in the array contains a substring

Example

inisin 3 11 22 33 44
# $? is 0
inisin 1 20 20 20
# $? is 1