I have two parameters: the list of linux group of user
groupsUsers=$(id -nG ${utilisateur})
the list of all the group linux of users (linux groups + applications)
list_all_groups=$(curl -u GET "${edge_admin_nodes}_${port_http}"/applications/lists)
How can I test if the groupsUsers exist in list_all_groups or no, and in the case "no" I store the result in a variable ?
I did this solution but I'm not sure that working.
for groupUser in ${groupsUsers}
do
if echo "$list_all_groups" | grep -o "$groupUser" then
echo "${groupUser}"
then
my_result=$( echo "$groups,$groupUser" )
result="${groups},\"${groupUser}\""
fi
done
$list_all_groupshave?