Jpp
JPrintHeaderFromFilelist.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Auxiliary script to print Monte Carlo header.
10 #
11 # ------------------------------------------------------------------------------------------
12 
13 if [ -z $JPP_DIR ]; then
14  echo "Variable JPP_DIR undefined."
15  exit
16 fi
17 
18 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
19 
20 set_variable WORKDIR /tmp/
21 
22 if ( do_usage $* ); then
23  usage "$script <input file>"
24 fi
25 
26 case $# in
27  1) set_variable INPUT_FILE $1;;
28 esac
29 
30 if [[ -z "`${INPUT_FILE}`" ]]; then
31 
32  echo "Running test"
33 
34  set_variable INPUT_FILE $WORKDIR/print_header.txt
35 
36  for (( i = 0; i < 1000; ++i )); do
37  echo "$JPP_DATA/genhen.km3net_wpd_V2_0.evt.gz" >> $INPUT_FILE
38  done
39 
40  wc -l ${INPUT_FILE}
41 
42  JPrintHeader \
43  -f "`cat ${INPUT_FILE}`"
44 
45  rm -f ${INPUT_FILE}
46 
47  exit
48 
49 fi
50 
51 JPrintHeader \
52  -f "`cat ${INPUT_FILE}`"