Help needed to sort data

Hello All,

Today i have been asking lots of question, hope to become good in scripting soon with all the wonderful advices i get. The question is i want to sort data a get uniq string from it. The code i am using to generate the output is:-

check_sun() {
for i in $SUN_PLATFORM
do
$ECHO "The path is: "$i
$LS $i | $GREP .su  | $AWK -F"_" '{print $1, path}' path="${i}"
done
}

The output i am getting right now is:

The path is: /vol/local_images/spins/7.1/CQ/sun5/ShareableEntities
base.sun5 /vol/local_images/spins/7.1/CQ/sun5/ShareableEntities
basement.sun5 /vol/local_images/spins/7.1/CQ/sun5/ShareableEntities

The path is: /vol/local_images/spins/7.1/CC/sun5/ShareableEntities
base.sun5 /vol/local_images/spins/7.1/CC/sun5/ShareableEntities
basement.sun5 /vol/local_images/spins/7.1/CC/sun5/ShareableEntities

The output i want is the unique out of the above output, for example:-

base.sun5 /vol/local_images/spins/7.1/CQ/sun5/ShareableEntities /vol/local_images/spins/7.1/CC/sun5/ShareableEntities
basement.sun5 /vol/local_images/spins/7.1/CQ/sun5/ShareableEntities /vol/local_images/spins/7.1/CC/sun5/ShareableEntities