From 0296c0f22b20b527fa2a4953f7f31dfd8bcf6b25 Mon Sep 17 00:00:00 2001 From: Junkun Date: Wed, 21 Jul 2021 00:07:28 -0700 Subject: [PATCH] refine shell --- examples/timit/local/timit_data_prep.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/timit/local/timit_data_prep.sh b/examples/timit/local/timit_data_prep.sh index 22e6f343..4bea057d 100644 --- a/examples/timit/local/timit_data_prep.sh +++ b/examples/timit/local/timit_data_prep.sh @@ -15,8 +15,13 @@ local=`pwd`/local utils=`pwd`/utils conf=`pwd`/conf -[ -f $conf/test_spk.list ] || error_exit "$PROG: Eval-set speaker list not found."; -[ -f $conf/dev_spk.list ] || error_exit "$PROG: dev-set speaker list not found."; +function error_exit () { + echo -e "$@" >&2; exit 1; +} +PROG=$(basename $0) + +[ -f $conf/test_spk.list ] || error_exit "$PROG line $LINENO: Eval-set speaker list not found."; +[ -f $conf/dev_spk.list ] || error_exit "$PROG line $LINENO: dev-set speaker list not found."; # First check if the train & test directories exist (these can either be upper- # or lower-cased