I'm making a script using BASH that greps the timestamp from a file (~/logs/Server_Info.log). Specifically,  I want to pull the hour digit from the timestamp and record it onto a variable. 

This is the format I used for the timestamp:

    date +"%b-%d-%Y-%I:%M:%S %p"

And I used this script to pull the data: 

    LAST_HOUR="$(( $(date +%I) - 1 ))"
    SEARCH_STRING=$(date +"%b-%d-%Y-${LAST_HOUR}:")
    timeval=$(grep "${SEARCH_STRING}" ~/logs/Server_Info.log)
    echo "$timeval"
    exit 0

However, whenever I execute this script, I either get two answers: 

*Blank output*



which was completely wrong, because my timestamp is

    Mar-24-2017-05:07:00 PM