expand_fcl.sh
Go to the documentation of this file.
1 #! /bin/bash
2 #------------------------------------------------------------------
3 #
4 # Purpose: Prints a canonicalized expansion of an fcl configuration
5 # file.
6 #
7 # Usage: expand_fcl.sh <fcl-file>
8 #
9 # Usage notes.
10 #
11 # 1. The larsoft environment must be initialized, in particular:
12 #
13 # a) The lar executable must be on the execution path.
14 #
15 # b) The fcl file search path $FHICL_FILE_PATH must be
16 # properly initialized.
17 #
18 # Created: H. Greenlee, 30-Jul-2013
19 #
20 #------------------------------------------------------------------
21 
22 # Parse arguments.
23 
24 fcl=''
25 if [ $# -gt 0 ]; then
26  fcl=$1
27 fi
28 
29 if [ x$fcl = x ]; then
30  echo "Usage: expand_fcl.sh <fcl-file>"
31  exit 1
32 fi
33 
34 # Use lar executable to expand the fcl script.
35 # Get rid of art boilerplate and redirect to standard output.
36 
37 export ART_DEBUG_CONFIG=1
38 lar -c $fcl 2>&1 >/dev/null | sed -n '2,$p'
39