In a text file, test.txt, I have the next information:
sl-gs5 desconnected Wed Oct 10 08:00:01 EDT 2012 1001
I want to extract the hour of
what I'd call a hack, but given that you're only processing hour values, you can do
hour=08 echo $(( ${hour#0} +1 )) 9 hour=10 echo $(( ${hour#0} +1)) 11
with little risk.
IHTH.