D
Deleted member 3607
Guest
Good evening everyone,
I am following a tutorial online for setting up the WPS/WRF and I would like to automate the process some in a script.
I am trying to write a IF/ELSE statement that will look at the UTC time on my desktop and round down to the nearest run.
This is what I have come up with but I can't see to get it to run.
Any help would be great!
#!/bin/bash
UTC_TIME= if [`date +%H -u` -ge 0] && [`date +%H -u` -lt 5]
then UTC_TIME=0
elif [`date +%H -u` -ge 6] && [`date +%H -u` -lt 11]
then UTC_TIME=6
elif [`date +%H -u` -ge 12] && [`date +%H -u` -lt 17]
then UTC_TIME=12
else [`date +%H -u` -ge 18] && [`date +%H -u` -lt 23]
UTC_TIME=18
fi
echo $UTC_TIME
I am following a tutorial online for setting up the WPS/WRF and I would like to automate the process some in a script.
I am trying to write a IF/ELSE statement that will look at the UTC time on my desktop and round down to the nearest run.
This is what I have come up with but I can't see to get it to run.
Any help would be great!
#!/bin/bash
UTC_TIME= if [`date +%H -u` -ge 0] && [`date +%H -u` -lt 5]
then UTC_TIME=0
elif [`date +%H -u` -ge 6] && [`date +%H -u` -lt 11]
then UTC_TIME=6
elif [`date +%H -u` -ge 12] && [`date +%H -u` -lt 17]
then UTC_TIME=12
else [`date +%H -u` -ge 18] && [`date +%H -u` -lt 23]
UTC_TIME=18
fi
echo $UTC_TIME