From 9ba0977084cb43d5bc85b0e9159b08d6563743b9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 11 Feb 2016 18:03:11 +0000 Subject: [PATCH] ECC-205: cleanup --- tools/bufr_filter | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/tools/bufr_filter b/tools/bufr_filter index 65714b6a1..d343ff57f 100755 --- a/tools/bufr_filter +++ b/tools/bufr_filter @@ -1,5 +1,4 @@ #!/bin/sh -#set -x script_dir=`dirname $0` EMOSLIB_TOOL=emoslib_bufr_filter @@ -40,23 +39,16 @@ if [ $# -eq 0 ]; then try_tool $ECCODES_TOOL if [ $result -eq $ERR_TOOL_NOT_FOUND ]; then try_tool $EMOSLIB_TOOL - #if [ $? -ne 0 ]; then - # echo "ERROR: Found neither $ECCODES_TOOL nor $EMOSLIB_TOOL" 2>&1 - # exit 1 - #fi fi exit 0 fi -# Now process arguments +# Now process arguments. The "-i" switch is specific to emoslib args="$@" for i in "$@" ; do case $i in - -i) - is_emoslib=1; - shift ;; - *) - shift ;; + -i) is_emoslib=1; shift ;; + *) shift ;; esac done @@ -65,15 +57,13 @@ if [ $is_emoslib -eq 1 ]; then pkg=emoslib tool=$EMOSLIB_TOOL try_tool $tool - retval=$? else pkg=ecCodes tool=$ECCODES_TOOL try_tool $tool - retval=$? fi -if [ $retval -ne 0 ]; then +if [ $result -eq $ERR_TOOL_NOT_FOUND ]; then echo "ERROR: Could not find the executable: $tool. Aborting!" 2>&1 echo " The arguments you passed in are relevant to $pkg" 2>&1 echo " Please make sure you have $pkg installed in your path" 2>&1