#!/bin/bash -f
function usage {
echo "
Enter a device pattern and attribute pattern, optionally 
preceeded by plotz options. The patterns must be regular expressions.   
Enter simply '-h' for more help, or go to 
https://confluence.slac.stanford.edu/display/ACCSOFT/Z-plots
 
  Examples:

  plotz> QUAD BDES                     All Quad BDESes
  plotz> -b 52 QUAD EACT               Quad EACTs in 52SL2 line
  plotz> [xy]cor:(in20|li2[1-5]) bdes  Correctors in IN20-LI25
  plotz> bpms:ltu. y1h                 BPM y orbit in LTU 
  plotz> -t -b 52 ((.cor)|quad) eact   Tabulate and plot EACTs in 52
  plotz> -h                            Get Help
  plotz> exit                          Exit plotz and close window
"
}

usage;
while read -ep "plotz> " && [ x"$REPLY" != x"exit" ]
do
  if [ x"$REPLY" != x"" ]; then 
    plotz $REPLY
  fi
done




