1 | #!/bin/sh |
---|
2 | |
---|
3 | RUNID=$(sed -n "/run_id/ s/^[[:space:]]*run_id[[:space:]]*=[[:space:]]*['\"]\([[:alpha:]]*\)['\"][[:space:]]*$/\1/p" ${WATCH_DIR}/problem.par) |
---|
4 | PNAME=$(sed -n "/problem_name/ s/^[[:space:]]*problem_name[[:space:]]*=[[:space:]]*['\"]\([[:alpha:]]*\)['\"][[:space:]]*$/\1/p" ${WATCH_DIR}/problem.par) |
---|
5 | |
---|
6 | RES=$(basename $(ls ${WATCH_DIR}/*.res 2> /dev/null | tail -n 1) 2> /dev/null | tr -d [a-zA-Z_\ .]) |
---|
7 | |
---|
8 | if [[ -n ${RES} ]] ; then |
---|
9 | WPREFIX=${WATCH_DIR}/${PNAME}_${RUNID}_${RES:1} |
---|
10 | else |
---|
11 | WPREFIX=${WATCH_DIR}/${PNAME}_${RUNID}_000 |
---|
12 | fi |
---|
13 | |
---|
14 | echo "WPREFIX = ${WPREFIX}" >> $HOME/my_debug.log |
---|
15 | |
---|
16 | echo 'qcg.monitor.scheme=piernik' |
---|
17 | if [[ -f ${WPREFIX}.log ]]; then |
---|
18 | tac ${WPREFIX}.log | grep -e "\s*@\s*0:\s*nstep\s*=" -m 1 || echo "-" |
---|
19 | else |
---|
20 | echo "${WPREFIX}.log does not exist" >> $HOME/my_debug.log |
---|
21 | echo "-" |
---|
22 | fi |
---|
23 | if [[ -f ${WPREFIX}.tsl ]]; then |
---|
24 | cat ${WPREFIX}.tsl |
---|
25 | else |
---|
26 | echo "${WPREFIX}.tsl does not exist" >> $HOME/my_debug.log |
---|
27 | fi |
---|