LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 09-28-2008, 06:28 AM   #1
dellroxy
Member
 
Registered: Jun 2008
Posts: 31

Rep: Reputation: 15
need you help about how to make this script


Dears,
kindly i am need your help about how to make this script
input for this script is
date like 01/10/2008
time as 17:30 - 17:45

the output of this script show at this rang of time what is files has been modefied and the full path of the file

thanks for your help
 
Old 09-28-2008, 07:16 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Looks like homework....

You'll want to first get familiar with the "find" command. This has flags to search based on three kinds of time. Experiment with the find command first, and then build the script around it.

Post your script here and people will be able to give more detailed help.
 
Old 09-28-2008, 07:34 AM   #3
jan61
Member
 
Registered: Jun 2008
Posts: 235

Rep: Reputation: 47
Moin,

assuming the command looks like this:
Code:
script.sh MM/DD/YYYY hh:mm-hh:mm
you could proceed like this (untested, you have to check if the Solaris touch command supports these options):
Code:
# create 2 timestamps YYYYMMDDhhmm to use in touch command
TSTAMP1=`echo "$1 $2" | sed -r 's|([0-9]+)/([0-9]+)/([0-9]+) ([0-9]+):([0-9]+)-[0-9]+:[0-9]+|\3\2\1\4\5|'`
TSTAMP2=`echo "$1 $2" | sed -r 's|([0-9]+)/([0-9]+)/([0-9]+) [0-9]+:[0-9]+-([0-9]+):([0-9]+)|\3\2\1\4\5|'`
# in your example the values would be:
# TSTAMP1=200810011730
# TSTAMP2=200810011745
# now create 2 files for find
touch -m -t $TSTAMP1 cmp_file1
touch -m -t $TSTAMP2 cmp_file2
# find the files with modification times between cmp_file1 and cmp_file2
find /path/to/directory -newer cmp_file1 ! -newer cmp_file2 -print
hth
Jan
 
Old 09-28-2008, 12:15 PM   #4
dellroxy
Member
 
Registered: Jun 2008
Posts: 31

Original Poster
Rep: Reputation: 15
very thanks for you i will doing this script and till you the result
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script executed inside another script dont make changes potraike Linux - Newbie 4 03-05-2008 05:27 AM
How do I make a simple script and make it run on bootup?? coolblue Programming 5 12-18-2006 09:55 PM
can i make a script or program make a phone call? nephish Linux - Software 2 08-15-2005 09:02 PM
make a script! okeyla Programming 7 02-07-2005 06:04 AM
Anyone know how to make a script that will ... kato678 Programming 4 07-19-2002 05:47 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 02:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration