Get reserved space for ext3 and ext4 devices on Linux

#!/bin/bash
#####
#ident "@(#) get_reserved_space.sh v 1.0 2017/02/20"
#
#  Author: Raymond Keckler
#
#  returns the percent amount of reserved space a 
#  device has set.  Uses tune2fs 
#
########################################

## color settings
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color

## Give usage message if the command was wrong
function usage()
{
    echo -e "${RED}usage: get_reserved_space --dev <device path and name>  ${NC}"
    echo -e "${GREEN}--dev /dev/sdb1${NC}"
}  

function get_reserved_space()
{
    local mydevice=$1
    myfstype=`df -T ${mydevice} | column -t | tail -1 | awk '{print $2}'`

    if [ "${myfstype}" == "ext4" ] || [ "${myfstype}" == "ext3" ]; then
        local BlockCount=`tune2fs -l ${mydevice} | grep "Block count:" | awk -F: '{print $2}' | xargs`
        local ReservedBlock=`tune2fs -l ${mydevice} | grep "Reserved block count:" | awk -F: '{print $2}' | xargs`
    else
	    echo "Filesystem type is not ext4"
	    exit 1
    fi
  
    answer=`echo "( $ReservedBlock / $BlockCount ) * 100" | bc -l`
    echo "Reserved space is set for ${answer%.*} Percent"

}


##
# Main
#

while [ "$1" != "" ]; do
    case $1 in
        --dev ) shift
                        device=$1
                        ;;
        * )         usage
                    exit 1
    esac
    shift
done

if [[ ("$device" == "") ]] ; then
    usage
    exit 1
fi

get_reserved_space "$device"