From f1054a71cadc8ee40c2278de6eb4bc1f15381293 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sat, 17 Nov 2018 19:48:28 +0100 Subject: [PATCH] Add some error messages --- test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 0393ca9..db44f5f 100755 --- a/test.sh +++ b/test.sh @@ -50,11 +50,14 @@ function usage (){ msg "\t**:**\n\n" } -echo " Hououuuu ${PWD}" +msg "**ADSILLH Bash return code test**\n" process_args $@ +[[ -z $COMMAND || -z $TEST_FILE ]] && error "You must specity a command and a test file" msg "Test $COMMAND script with $TEST_FILE\n\n" cd $DIR +[ ! -f $COMMAND ] && error "script **$COMMAND** not found" + while IFS='' read -r i || [[ -n "$line" ]]; do args=$(echo $i | cut -d: -f1) e_code=$(echo $i | cut -d: -f2)