Ignore:
Timestamp:
09/05/21 07:13:17 (3 years ago)
Author:
maslowski
Message:
Added Telescope as command line parameter. And fixed some bugs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/hawc/processing/DiskToDB/extract-aux-data2.sh

    r20103 r20104  
    3030# File to which the queries are written
    3131OUTPUT="insert-aux.sql"
    32 TMPOUT="./tmpAuxOut.sql"
    3332# The Mars build directory
    34 readonly MARS="/home/frankm/Dateien/Mars-6.24.00/build4/"
     33readonly MARS="/home/hawc/Desktop/Mars/"
    3534# The path to your Mars/build directory where the processing macros are stored
    36 # MACROS="/home/frankm/Dateien/Mars/hawc/processing"
    37 readonly MACROS="/home/frankm/Dateien/Mars-6.24.00/build/Masterarbeit/Datenbank/HE01/Mexico/Cfiles/"
     35readonly MACROS="/home/hawc/Desktop/Mars-src/hawc/processing/"
    3836readonly PROGRAM=$0
    3937INSERT="INSERT INTO"
     
    9694NIGHT="${4}"
    9795
     96TMPOUT="./tmpAuxOut-${TEL}.sql"
    9897ERRCODE=
    9998
     
    318317
    319318# Delete last comma and replace it with closing parintheses
    320 sed -i '$s/,/)/' "${OUTPUT}"
    321 
    322 # Finish the query file with defining the column names
    323 echo "\
     319if [ -f "${TMPOUT}" ]
     320then
     321        sed -i '$s/,/)/' "${OUTPUT}"
     322
     323        # Finish the query file with defining the column names
     324        echo "\
    324325AS
    325326v(
     
    337338"\ >> ${OUTPUT}
    338339
    339 cat ${TMPOUT} >> ${OUTPUT}
     340else
     341        head -n -4 "${OUTPUT}" > out.sql.new && mv out.sql.new "${OUTPUT}"
     342fi
     343
     344if [ -f "${TMPOUT}" ]
     345then
     346        cat ${TMPOUT} >> ${OUTPUT}
     347fi
    340348
    341349rm -f ${TMPOUT}
Note: See TracChangeset for help on using the changeset viewer.