#!/bin/bash
#==============================================================
#
#  Abs:   caGet1 a list of PVs for given IOC.
#
#  Name:  getIOCPVs
#
#  Rem:   getIOCPVs looks at $IOC_DATA/<ioc>/iocInfo/IOC.pvlist
#         and uses caGet1 to take a snapshot of IOC.pvlist.  A
#         PV attribute is appended to the end of the PV name.
#
# Usage:  getIOCPVs <ioc-node-name> <PV_Attribute>
#
# Output: file: <ioc-node-name><PV_Attribute>_Values
#
#  Auth:  25-Feb-2009, W. Colocho
#  Rev:
#
#---------------------------------------------------
# Mods: (Latest to oldest)
#
#
#

theIOC=$1
pvAttribute=$2
cat $IOC_DATA/$theIOC/iocInfo/IOC.pvlist | sed 's/\([^,]*\).*/\1.'${pvAttribute}'/' > /tmp/${theIOC}_$pvAttribute
caGet1 /tmp/${theIOC}_$pvAttribute ${theIOC}_${pvAttribute}_Values
rm /tmp/${theIOC}_$pvAttribute
