On Mon, Apr 28, 2003 at 02:27:52PM -0500, Gerald Skerbitz wrote:
> On Mon, 28 Apr 2003 list at slushpupie.com wrote:
> I'm looking for resolution to the minute -- what's displayed in an ls --
> and not a relative number of minutes either since that won't work once the
> clock changes.
> 
> I want to find all files with the same time as another file
> and find should do that and doesn't.  Oh well.

Well you should be able to sling something together using bc and
date.

Something like:

s1=$(date  -r TARGET_FILE +%s); s2=$(date  +%s); cmin=$(echo
"scale=0; ($s2 -$s1) /60" |bc -l);find -cmin $cmin

Of course that truncates instead of rounding ctime, so you'd
probably want to make a time range (or better yet figure out how
to get bc to round):

s1=$(date  -r TARGET_FILE +%s); s2=$(date  +%s); cmin_high=$(echo
"scale=0; ($s1 -$s2) /60 -1" |bc -l); cmin_low (echo
"scale=0; ($s2 -$s1) /60" |bc -l); find -cmin $cmin_high -cmin
+$cmin_low

That's so ugly, that you ar eprobably better off sticking with
your current kludge.

-- 
Jim Crumley                  |Twin Cities Linux Users Group Mailing List (TCLUG)
crumley at fields.space.umn.edu |Minneapolis/St. Paul, Minnesota 
Ruthless Debian Zealot       |http://www.mn-linux.org/ 
Never laugh at live dragons  |Dmitry's free,Jon's next? http://faircopyright.org

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list