Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash script language check if item in array

array=(staging prod)

if [[ ${array[*]} =~ $1 ]]; then
    echo "Supported Environment";
else
    echo "Unsupported Environment";
fi
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #script #language #check #item #array
ADD COMMENT
Topic
Name
2+7 =