I have 2 strings "planning1" and "planning2" , I have to check if both the strings are present (whole and complete) in the same array ("active","planning","delete")
expected output: if both the strings present -> echo "true" even if one of the string is not present in the list then -> echo "false"
I have previously tried , but it does not work as expected
#!/bin/bash
declare -a test_array
test_array=( "active" "teardown" "planning" )
[[ " $test_array " =~ " active " ]] && [[ " $test_array " =~ " planning " ]] && echo 'yes' || echo 'no'