Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

0 views
Skip to first unread message

kirankum...@gmail.com

unread,
Dec 7, 2007, 6:41:26 AM12/7/07
to
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... :-))


Robert Harris

unread,
Dec 7, 2007, 9:59:53 AM12/7/07
to
date(1) should do the conversions you need.

Robert

Bill Marcum

unread,
Dec 7, 2007, 9:23:47 AM12/7/07
to
What do you think the "00000000" represents in
touch -t 00000000 /tmp/timestamp ?
I think you want
touch -t ${date}0000 /tmp/timestamp
0 new messages