Finding modified File List after the chosen date in Korne Shell... - Unix

This is a discussion on Finding modified File List after the chosen date in Korne Shell... - Unix ; I am trying to write a Korne Shell asking the user for a date and a directory and then search recursively in this directory the list of files modified after the date chosen. But I am not getting good results ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Finding modified File List after the chosen date in Korne Shell...

  1. Finding modified File List after the chosen date in Korne Shell...

    I am trying to write a Korne Shell asking the user for a date and a
    directory and then search recursively in this directory the list of
    files modified after the date chosen. But I am not getting good
    results when I check it...

    #!/usr/bin/ksh
    echo "Enter a date (YYYYMMDD) "
    read date
    touch -t 00000000 /tmp/timestamp
    echo "Enter a directory.."
    read dir
    find "$dir" -type f -newer /tmp/timestamp


    I earlier used -mtime, but it should not be used, as -mtime searches
    for files older by no. of days and not for files modified after a
    particular date.

    Can anyone please provide with some pointers to my above Code wrt the
    mistakes that I did..

    Thanks a lot in advance... :-))



  2. Re: Finding modified File List after the chosen date in Korne Shell...

    kirankumar.techy@gmail.com wrote:
    > I am trying to write a Korne Shell asking the user for a date and a
    > directory and then search recursively in this directory the list of
    > files modified after the date chosen. But I am not getting good
    > results when I check it...
    >
    > #!/usr/bin/ksh
    > echo "Enter a date (YYYYMMDD) "
    > read date
    > touch -t 00000000 /tmp/timestamp
    > echo "Enter a directory.."
    > read dir
    > find "$dir" -type f -newer /tmp/timestamp
    >
    >
    > I earlier used -mtime, but it should not be used, as -mtime searches
    > for files older by no. of days and not for files modified after a
    > particular date.
    >
    > Can anyone please provide with some pointers to my above Code wrt the
    > mistakes that I did..
    >
    > Thanks a lot in advance... :-))
    >
    >

    date(1) should do the conversions you need.

    Robert

+ Reply to Thread