3 # Lists all the FCL files whose name matches the specified pattern.
5 # Usage: ListFCL.sh [Pattern]
7 # The pattern is a regex as interpreted by grep ("-e" option).
12 : ${FORMAT:=
"%f (in %h)"}
16 Looks
for FHICL files
in the ART FHICL search directories.
23 the placeholder
are as documented
in find (1) manual
35 [[ -
n "${!VarName//0}" ]]
38 function
STDERR() { echo
"$*" >&2 ; }
43 STDERR "FATAL ERROR (${Code}): $*"
48 [[
"$Code" != 0 ]] &&
FATAL "$Code""$@"
53 if [[ -
n "$Pattern" ]]; then
60 function CleanSortKey() { sed -
e 's/^[^ ]* \+//' ; }
62 function ApplyFormat() {
67 local Path=
"${Data#*/}"
71 echo "${FileName} (
in ${Path})
"
74 sed -e "s@\([^\]|\^\)%f@${FileName}
@" -e "s@\([^\]|\^\)%
h@${Path}
@" <<< "$Format
"
79 ################################################################################
81 declare -i NoMoreOptions=0
83 declare -i nPatterns=0
84 for (( iParam = 1 ; iParam <= $# ; ++iParam )); do
86 if ! isFlagSet NoMoreOptions && [[ "${
Param:0:1}
" == '-' ]]; then
88 ( '--help' | '-h' | '-?' ) DoHelp=1 ;;
91 ( '--name' | '-n' ) FORMAT="%f
" ;;
92 ( '--path' | '-p' ) FORMAT="%
p" ;;
93 ( '--format='* ) FORMAT="${
Param#--*=}
" ;;
100 echo "Unrecognized script
option #${iParam} -
'${Param}'"
106 Patterns[nPatterns++]="$Param
"
110 if isFlagSet DoHelp ; then
112 # set the exit code (0 for help option, 1 for missing parameters)
118 # - start with paths in FHICL_FILE_PATH
120 # - find in all those directories (but not in their subdirectories),
121 # and in that order, all the FCL files
122 # - print for each its name and the string to be presented to the user as output
123 # - soft them by FCL file name, preserving the relative order of files with the
124 # same name from different directories
125 # - filter them on sort key (file name) by user's request
126 # - remove the sort key (file name) from the output
127 tr ':' "\n" <<< "$FHICL_FILE_PATH
" | xargs -I SEARCHPATH find SEARCHPATH -maxdepth 1 -name "*.fcl
" -printf "%f ${FORMAT}
\n" 2> /dev/null | sort -s -k1,1 -u | Filter "^[^ ]*${Patterns[0]}[^ ]*
" | CleanSortKey
static std::string format(PyObject *obj, unsigned int pos, unsigned int indent, unsigned int maxlen, unsigned int depth)
esac done echo Signal files are
do one_file $F done echo for F in find $TOP name CMakeLists txt print
then echo Sam station was not specified(use option--sam_station)." exit 1 fi if [ x$SAM_GROUP
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
do case in h help echo Usage
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
then echo File list $list not found else cat $list while read file do echo $file sed s
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker options
BEGIN_PROLOG triggeremu_data_config_icarus settings sequence::triggeremu_data_config_icarus settings PMTADCthresholds sequence::triggeremu_data_config_icarus settings PMTADCthresholds sequence::triggeremu_data_config_icarus settings PMTADCthresholds Pattern