Can anyone help me out in giving a script for my requirement please..
I have a number of files in a directory like
somenumber.0100
somenumber.0130
somenumber.0159
somenumber.0300
somenumber.0330
somenumber.0525
.
.
.
here, the number after the dot is the time (hhmm)
I need a script to list out all such files between 2 different times.
For example, This needs to satisfy different conditions like:
-files between 0100 and 0130 (mm of start < mm of end)
-files between 0100 and 0300 (hh of start > hh of end)
-files between 0100 and 0359 (mm of start < mm of end)
-files between 0159 and 0500 (mm of start > mm of end)
and also to pull a particular information/pattern from each of the listed files say if 50 files are listed get 50 patterns (one from each) but the pattern wud be similar... how to iterate over 50 files?
how many 'conditions' will you have?
For the sample conditions:
-files between 0100 and 0130 (mm of start < mm of end)
ls *.01[1-3]*
-files between 0100 and 0300 (hh of start > hh of end)
ls *.0[1-3]*
-files between 0100 and 0359 (mm of start < mm of end)
ls *.0[1-3][0-5][0-9]
-files between 0159 and 0500 (mm of start > mm of end)
Need a script which takes the start time and end time as inputs. So, for any time interval the files in the directory somenumber.* shud be listed
Say for example I have the following files
*.0110
*.0115
*.0130
*.0145
*.0200
*.0215
*.0332
*.0358
*.0400
*.0430
*.0445
If I give 0100 to 0210 to my script as arguments result shud be
*.0110
*.0115
*.0130
*.0145
*.0200
Similarly if I give 0400 to 0500
*.0400
*.0430
*.0445