aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/ciao_calc_ct_csb.sh
diff options
context:
space:
mode:
authorWeitian LI <liweitianux@gmail.com>2014-12-11 17:25:51 +0800
committerWeitian LI <liweitianux@gmail.com>2014-12-11 17:25:51 +0800
commit84f331ff79270943846d55555abd8a788cc16852 (patch)
tree9ee60a0b863dcb7ec6ce2e1ba8f0a481a560accf /scripts/ciao_calc_ct_csb.sh
parent18ec6e75828a442f8da29be13e88c5197e15f886 (diff)
downloadchandra-acis-analysis-84f331ff79270943846d55555abd8a788cc16852.tar.bz2
ciao_calc_ct_csb.sh: test ${CT_RES} before read.
Diffstat (limited to 'scripts/ciao_calc_ct_csb.sh')
-rwxr-xr-xscripts/ciao_calc_ct_csb.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/ciao_calc_ct_csb.sh b/scripts/ciao_calc_ct_csb.sh
index eccafb3..bee6316 100755
--- a/scripts/ciao_calc_ct_csb.sh
+++ b/scripts/ciao_calc_ct_csb.sh
@@ -6,6 +6,10 @@
## ##
## Weitian LI ##
## 2014/06/18 ##
+## ##
+## ChangeLog: ##
+## 1.1, 2014/12/11, Weitian LI ##
+## test ${CT_RES} before read ##
###########################################################
BASE_PATH=`dirname $0`
@@ -27,8 +31,13 @@ CT_RES="cooling_results.txt"
CSB_RES="csb_results.txt"
# cooling time
-TITLE_CT=`grep -E '^#\s*[A-Z]+' ${CT_RES} | awk -F',' '{ print $3 }'`
-DATA_CT=`grep -E '^#\s*[0-9]+' ${CT_RES} | awk -F',' '{ print $3 }'`
+if [ -r "${CT_RES}" ]; then
+ TITLE_CT=`grep -E '^#\s*[A-Z]+' ${CT_RES} | awk -F',' '{ print $3 }'`
+ DATA_CT=`grep -E '^#\s*[0-9]+' ${CT_RES} | awk -F',' '{ print $3 }'`
+else
+ TITLE_CT=""
+ DATA_CT=""
+fi
# Csb
TITLE_CSB=`grep -E '^#\s*[A-Z]+' ${CSB_RES}`