• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Datewise File search

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I hae a need of a Unix shell script which prompt me to input "From" and "To" date (dd/mm/yyyy) format. When I press enter it should print all the file names modified between given dates. e.g.
Consider following list of files in a particular directory –

File Name Date Modified (dd/mm/yyyy)

a.txt 12/01/2009
b.txt 11/01/2009
c.txt 10/01/2009
d.txt 09/01/2009
e.txt 08/01/2009
f.txt 07/01/2009
g.txt 06/01/2009
h.txt 05/01/2009

If I input From date = 06/01/2009 And To date = 09/01/2009, Then output should be -

g.txt
f.txt
e.txt
d.txt

Thanks a lot For any help.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please note that Java Ranch is not a code mill. Have you written anything so far? If so, what do you have working and what isn't working? Then someone might step up and help you get the broken part working.
 
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Unix/Linux, one generally would not write code to do this, as the 'find' command does it with zero programming.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Type 'man find' for information on how the 'find' command works.
reply
    Bookmark Topic Watch Topic
  • New Topic