This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Advice on where to look to solve a problem


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:

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


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]