#!/bin/bash -f
#
# areas prints the unique areas (IN20, LI22 etc) in a beamline, as emitted by 
# aida "modelTwiss" queries. In general, any file where column 3 is a list
# of device names that contain area names may be used. 
#
# Usage:
#   aidaget modelTwiss//Design.<beamline> | areas
#
# Example:
#   aidaget modelTwiss//Design.FullMachine | areas
# 
# The above would produce a \n separated list of the areas in the FullMachine. 
#
# See aidalist modelTwiss Design.% for a list of model beamlines.
# 
# Rem: "areas" is required to wrap areas.awk because it seems the -W 
# options can't be given to awk in the shell interpreter mode 
# (ie #!/bin/awk --re-interpret).

AWK_DIR=/usr/local/lcls/tools/script
awk -W re-interval -f ${AWK_DIR}/areas.awk
