Say I have these two "lists":
#!/usr/bin/env bash
git fetch origin;
first_list=( );
second_list=( );
git branch --merged "remotes/origin/dev" | tr -d ' *' | while read branch; do
first_list+=( "$branch" );
done
git branch --merged HEAD | tr -d ' *' | while read branch; do
second_list+=( "$branch" );
done
I need to create a third list that holds the intersection of elements in the first and second lists. How can I do that?