I want to use the below but since the date has a space it doesn't grep exactly what's needed. I need to keep the quotes around the variable when it passes it. I need the quotes around $DATE2 just to recognize the variable. Thanks in advance for any help given.
D=`date +%d`
DN=`echo -n $D | wc -c`
if [ $DN = 1 ]; then
DATE2=`date "+%b %d"`
elif [ $DN = 2 ]; then
DATE2=`date "+%b %d"`
fi
FL=`ssh -q $SERVER grep "$DATE2" /var/log/secure | grep Failed | grep -Po "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" | sort | uniq -c | tr "\n" " "`