#!/bin/bash -f
function usage {
echo "
 uniqattr lists the uniq attributes of the EPICS PVs (actually 
 any AIDA instance name - not necessarily EPICS PVs) matching 
 a pattern.

 Usage: uniqattr PV-name

 Example: uniqattr WATR:%   - the unique attributes of WATR types PVs.

 uniqattr is useful for using with valz_devices or plotz_devices, for 
 choosing what property you want to plot.
"
}
# Process options. Just 1 in this case, "h" for help.
while getopts h opt
do
   case "$opt" in
       h) usage; exit 0 ;;
       *) echo "Unknown options, see uniqattr -h";exit 1;;
   esac
done
shift $((OPTIND-1))

# Check for insufficient arguments
if [ $# -lt 1 ]; then
   echo "Too few arguments, see uniqattr -h for help."
   exit 1;
fi

# Ok, after all that, do it.
aidalist ${1} | cut -d":" -f 4- | sort -u
