Basic bach scripting
I have a simple task to perform with a script.
Test for the current hour, if it is 22 then init 0 To test my code I am using the echo command with date. The following line gives unknown command: hour = $date +%H This just echos the text "date +%H" echo date +%H This echoes the current hour: date +%H This is what I'm actually trying to do: ############# hour = $date +%H if $hour = 22 ; then init 0 fi ############# How do I properly assign the current hour to a variable the work with it? |
hour = $( date +%H )
|
Or
Code:
hour=`date +%H` |
Quote:
sorry.........couldn't resist. Feeling a little silly today :p No offense :) |
Bingo!
thank you |
All times are GMT -5. The time now is 08:47 PM. |