The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find command from a shell script kodermanna UNIX for Advanced & Expert Users 6 01-28-2008 02:37 AM
Shell script to Find file size ragsnovel Shell Programming and Scripting 1 08-10-2007 07:01 AM
Can anyone find a bug in this code?? shell script amon Shell Programming and Scripting 1 09-18-2006 11:11 PM
NEWBIE: If and Find in shell script meskue Shell Programming and Scripting 1 06-29-2006 10:28 PM
shell script to find files naren_samba2005 Shell Programming and Scripting 2 10-21-2005 02:06 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-25-2008
Registered User
 

Join Date: Mar 2008
Posts: 11
c shell script help with find

Okie here is my problem,

1. I have a directory with a ton of files.
2. I want to first get an input on how many days ago the files were created.
3. I will take those files and put it into another file
4. Then I will take the last # from each line and subtract by 1 then diff the line from the file from the line that was subtracted.

I was thinking of first using
ex: "find . -name '*file_num_*' -print > latestfiles"
then i am unsure of where to go from there.

is there a flag on find that will let me take the files created within a date range of certain number of days ago?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-25-2008
Registered User
 

Join Date: Mar 2008
Posts: 11
okie heres what i got so far in ksh

1. asks for number of days file was created...
2. "read day_ago"
3. "find . -name '*file_num_*' -mtime -$days_ago -print > File"

Now i just need to know how to subtract the last 2 characters from each line on the file by 1

then diff the original with the subtracted version.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0