I need to write a shell script that will create a list of 5 minutes interval times.
00-00
00-05
00-10
00-15
...
...
23-50
23-55
Here are the commands I have started with.
# date
Fri Sep 21 18:14:35 IST 2012
# date '+%H-%M'
18-14
# date '+%H-%M' --date='5 minute ago'
18-18
How do I write a script to generate the list? If it is too complicated, I will do it manually since it is one time task.
Update:
The following script is working. But it will generate single digits like 7-5 should actually be 07-05
#!/bin/sh
for hour in `seq 0 24`
do
for minute in `seq 0 5 59`
do
echo $hour-$minute
done
done
The following shell scripting is returning the required data
#!/bin/sh
for hour in `seq -w 0 24`
do
for minute in `seq -w 0 5 59`
do
echo $hour-$minute
done
done