Jpp  master_rocky-43-ge265d140c
the software that should make you happy
input-files.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 # --------------------------------------------------------------------------------------------
5 #
6 # Auxiliary script to copy input files.
7 #
8 # --------------------------------------------------------------------------------------------
9 
10 if [ -z $JPP_DIR ]; then
11  echo "Variable JPP_DIR undefined."
12  exit
13 fi
14 
15 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
16 
17 set_variable DEBUG 2
18 set_variable WORKDIR ${TMPDIR:-/tmp}
19 
20 if do_usage $*; then
21  usage "$script <detector identifier> <detector identifier>"\
22  "\nAuxiliary script to copy input files."
23 fi
24 
25 if (( $# != 2 )); then
26  fatal "Wrong number of arguments."
27 fi
28 
29 source JAcousticsToolkit.sh
30 
31 if [[ $1 != [1-9][0-9]* ]] || [[ $2 != [1-9][0-9]* ]]; then
32  JCookie.sh
33 fi
34 
35 ID=($(getDetector -D $1 -O int)
36  $(getDetector -D $2 -O int))
37 
38 if (( $ID[1] == $ID[2] )); then
39  fatal "$1 and $2 are the same detector"
40 fi
41 
42 RUNS=(1 99999999)
43 VERSION=master
44 
45 for KEY in $ACOUSTICS_KEYS[*]; do
46 
47  rm -f $WORKDIR/${KEY}.txt >& /dev/null
48 
49  getFile.sh $JPP_DIR/inputs $ID[1] $RUNS[1] $KEY $VERSION $WORKDIR/${KEY}
50 
51  if (( $? != 0 )); then
52  fatal "Abort."
53  fi
54 
55  putFile.sh $WORKDIR/${KEY}.txt $JPP_DIR/inputs $ID[2] $RUNS[1] $RUNS[2] $KEY $VERSION
56 done
57 
58 rm -f $WORKDIR/${^ACOUSTICS_KEYS}.txt >& /dev/null