# Aggregate the groups each test belongs to for the group file
grep -I -R "^_begin_fstest" $test_dir/ | \
- sed -e "s/^.*\/\($VALID_TEST_NAME\):_begin_fstest/\1/" \
- >> $new_groups
+ sed -e "s/^.*\/\($VALID_TEST_NAME\):_begin_fstest/\1/" | \
+ sort -ug >> $new_groups
# Create the list of unique groups for existence checking
grep -I -R "^_begin_fstest" $test_dir/ | \