delete semi-duplicate lines from file?

Ok here's what I'm trying to do. I need to get a listing of all the mountpoints on a system into a file, which is easy enough, just using something like "mount | awk '{print $1}'"

However, on a couple of systems, they have some mount points looking like this:

/stage
/stand
/usr
/MFPIS
/MFPIS/archive
/orabck
/orabck/tmp

Notice how they've got some mount points called say, "/MFPIS" and then another called "/MFPIS/archive".

I need to somehow strip out of the list the ones that have the secondary directory in them. So from the list above, my goal would be to get a list that looks like this:

/stage
/stand
/usr
/MFPIS
/orabck

Any ideas would be appreciated.
Thanks.

awk '!x[$2]++' FS="/" input

Use nawk or /usr/xpg4/bin/awk on Solaris.

So, the entire command should be something like this:

mount|awk '!$1&&!x[$2]++&&$0="/"$2' FS="[/ ]"

Thanks, I'll give that a try.