I am getting a bad substitution error for the following line:
cur_hour=${cur_hour:11:2}
The relevant code is here:
while :
do
cur_hour=`date`
cur_hour=${cur_hour:11:2}
if [ <some comparisons> ]
then
<some other code here>
fi
done
When I try the "trouble" code manually it works fine but in the script it causes the error. Any help is appreciated.