This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Advice on where to look to solve a problem
- From: Randall R Schulz <rschulz at sonic dot net>
- To: cygwin at cygwin dot com
- Date: Tue, 08 Jul 2003 07:57:19 -0700
- Subject: Re: Advice on where to look to solve a problem
Steve,
This is elementary Unix script programming. Well, maybe intermediate scripting.
The "find" command will do everything you want. Read the man page ("man
find"). It's chock full 'o options.
I do suggest you clarify your file age criteria. File time stamps have
approximately second-level resolution (though find gives you only
minutes or days as an age specification) so saying "older than the
current date" sounds a little ambiguous. (No doubt you know what you
mean. Just be sure you get it straight before writing your script or
developing your find incantation.)
Find also allows you to use the modification time of an existing file
as the age reference. In conjunction with this, you might want to
review the capabilities of the "touch" command, which allows to you set
the modification time of a file to an arbitrary value.
Good luck.
Randall Schulz
At 07:31 2003-07-08, Steve wrote:
Hi;
I'm on windows 2000 with cygwin.
I need to make a script that will check all of the file modified dates
on all of the files in a list of directories. If any of these dates
is older then the current date I want to print the name of the file
and the date to a file.
I'm new to bash scripting and many unix commands. What are the
commands that I want to loook at that could do these things for me?
Thanks in advance
Steve
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/