Answers for "bash script in array"

0

bash script in array

if [[ " ${array[@]} " =~ " ${value} " ]]; then
    # whatever you want to do when array contains value
fi

if [[ ! " ${array[@]} " =~ " ${value} " ]]; then
    # whatever you want to do when array doesn't contain value
fi
Posted by: Guest on May-04-2021

Browse Popular Code Answers by Language