From: Sundar_Rajan () socgen-crosby ! com
To: tru64-unix-managers
Subject: Consolidated solution on finding current date files.
Date: Fri, 08 May 1998 07:08:15 +0000 [thread overview]
Message-ID: <96078708811461.tru64-unix-managers.marc@archive.invalid> (raw)
Hello All,
Solution is finally found. Thanx for all who helped and tried helping.
I would like to distribute the compiled solutions from different sources.
Hope it will be useful sometimes.
Soln 1
ls -lR | grep "$TODAY"
Soln 2
if ($key!=""){
$key = Chop(ereg_replace("( )+"," ",$key));
// replace one or more spaces with only one
if ($key[0]==' ') $key =
substr($key,1,strlen($key)-1);
// remove leading space
}
Soln 3
ls -la | grep -E 'May[[:space:]]*7'
Soln 4
touch -t `date +%m%d0000` /tmp/midnight
find $dir -newer /tmp/midnight -print
Soln 5
touch /tmp/this_backup
find $dir -newer /tmp/last_backup -print | whatever
# do your backup.
# If successful:
mv -f /tmp/this_backup /tmp/last_backup
Soln 6
% touch -t `date +%m%d`0000 today.key
% ls -l today.key
-rw-r----- 1 yakoshi system 0 May 7 00:00 today.key
% find . -newer today.key -print
.
./Mail/inbox
./Mail/inbox/1
:
% find . -newer today.key -type f -exec ls -l {} \;
-rw------- 1 yakoshi system 355 May 7 12:15 ./Mail/inbox/1
:
Soln 7
find . -mtime -1 -print
Soln 8
month=May
day=7
success=0
ls -lR | while read output; do
set -A field $output
[[ ${field[5]} = $month ]] && [[ ${field[6] = $day ]] && {
success=1
break
}
done
awk
ls -lR | awk '$6 = "'"$month"'" && $7 == "'"$day"'"' # prints
matches
Soln 9
touch -t 980506115959 /tmp/somefile
find /somedir -newer /tmp/somefile
Soln 10
TODAY_DAY='7'
TODAY-MONTH='May'
ls -lR | egrep "${MONTH} [ ]*${DAY}"
Sunder
P.S : Please ignore the autosignature below
********************************************************************
The information contained in these documents may be confidential and is intended
for the exclusive use of the addressee designated above. If you are not the
addressee, any disclosure, reproduction, or other dissemination or use of this
communication is strictly prohibited. If you have received this transmission in
error please contact us immediately by telephone so that we can arrange for its
return.
********************************************************************
reply other threads:[~1998-05-08 7:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox