#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    6
    Rep Power
    0

    Command to print the dates between a Range


    Hi All,

    I am new to this Forum & LINUX. I am sure I am probably going to ask one simple 'How to' question on LINUX.

    Can you pls help me with a command to print the dates between a date range. If I pass the current date & 20111218, it should print all the dates between these 2 as the output.

    I dont want to use a Script to do it, looking for a single command instead.

    Appreciate your help in this.

    Freddie
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    I don't know of any single commands that have this feature.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    6
    Rep Power
    0

    Script to Combine the N days files that falls between a Date Range


    Thanks Oreo for your reply.

    Let me put the requirement clearly.

    1) We store the last run date of a process in a file. When the batch run the next time, it should read this file, get the last run date from the file. Using this date, the script should read all the files from the Directory that falls between Current Date & previous run date (the date we got from file) & combine it into one Single file for further processing.

    Any help/thoughts on how to accomplish this through Shell Script/multiple commands will be highly appreciated.

    Thanks in Advance,
    Freddie
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,441
    Rep Power
    1688
    Use that date/time to touch (touch -t I think it would be) a dummy file to set it's last modification date/time and use the relevent -newer (I think) option of a find command to list all files modified since that date.
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc

IMN logo majestic logo threadwatch logo seochat tools logo