![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Homework & Coursework Questions Students must use and complete the template provided. If you don't, your post may be deleted! Special homework rules apply here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to script to find the newer date in a text file? | boolean2222 | Shell Programming and Scripting | 6 | 08-10-2009 03:15 PM |
| find -cmin or fin -newer | xxxyyyy | UNIX for Advanced & Expert Users | 2 | 11-18-2008 08:31 AM |
| Searching the file system | LiquidChild | UNIX for Dummies Questions & Answers | 9 | 06-01-2007 11:00 AM |
| Problem with find ! -newer | dbfree | Shell Programming and Scripting | 3 | 12-19-2005 10:56 PM |
| searching for a string though file system | peter.herlihy | UNIX for Dummies Questions & Answers | 3 | 12-06-2001 04:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Searching Through File System using find -newer
1. The problem statement, all variables and given/known data:
Problem Statement for project: When an account is created on the CS Unix network, a public html directory is created in the account’s home directory. A default web page is put into that directory. Some users replace or edit the default page, while others do not. We would like to add a new link from the department web page to another page which lists all students who have changed their web page from the default. We don’t want to track these things by hand, and we want the list to be automatically updated every night at 3:00AM. You are to write a script that will 1. find all users who are students and who have changed their web page from the default that was provided when their account was created, 2. generate an HTML file named student web pages.html which contains a nicely formatted list of links to each student web page that you found, 3. copy that file into a directory specified on the command line, and 4. make sure that anyone can read it. My Problem: I do not have a problem with this project just a single aspect for searching through the file system using find -newer. My problem is how to get the -newer file to be within the same users path that the find command is already transversing through. My attempts are below. Any help would be great. Thanks. 2. Relevant commands, code, scripts, algorithms: find -newer 3. The attempts at a solution (include all code and scripts): Here is the command that I am using to transverse the file system: Code:
$ find ./undergrad[1-5]/*/public_html/index.html The first * represents a user account within the 5 undergrad directories. I need to figure out how to use -newer to be in the same user account that the above command is in at the time is compares it to the -newer file. Here is the command that I tried using but I don't think it worked. Code:
$ find ./undergrad[1-5]/*/public_html/index.html -newer ./*/.profile I am trying to compare the index.html file of a user to their .profile file so see if it has been modified since the account was created. However, I think that newer is looking at the .profile of any directory from the current directory. 4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course): Texas Tech University Lubbock TX USA Dr. Pyeatt CS 3352 Thanks for the help. |
|
||||
|
ok, that is a much better idea, I forgot that you can change your .profile. But where would that typicaly be loacted on a unix server. Would it a a file that is unique to each user or would it be stored some where else? I tried using find skel from /etc directory and came up with these results:
Code:
$ find skel skel skel/.profile skel/local.cshrc skel/local.login skel/local.profile ---------- Post updated at 10:20 AM ---------- Previous update was at 09:58 AM ---------- Nevermind I used newer against /etc/skel/.profile and it seemed to work. If you still think that I am doing it wrong Please let me know, but Thanks again for the help I was starting to get frustrated with this project. |
|
|||||
|
I meant the template for the index.html file. The problems if your comparing the time against the /etc/skel/.profile file are
|
|
||||
|
ok so I relized that we have like 10 unix servers, and each of the files that I am comparing to was created at different times. So I need to find a way to use diff on a know unedited index.html, and get the file path instead of the normal diff out put. Any ideas? thanks
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|