From 84f331ff79270943846d55555abd8a788cc16852 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Thu, 11 Dec 2014 17:25:51 +0800 Subject: ciao_calc_ct_csb.sh: test ${CT_RES} before read. --- scripts/ciao_calc_ct_csb.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'scripts/ciao_calc_ct_csb.sh') 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}` -- cgit v1.2.2