how to compare string in bash? I only want to compare words, not word order for example i have variable
VAR1=eu-endpoint-2021.09.20 prod-store-2021.09.20 service-trace-2021.09.20
and another variable that stores the same info but with different order
VAR2=prod-store-2021.09.20 eu-endpoint-2021.09.20 service-trace-2021.09.20
and how can i compare this only by words? nor the words order for example
if $VAR1 == $VAR2
then
do smth;
else
do smth;
fi