GNU bug report logs - #49428
RFE: for --time have option to only include contents, not dir itself.

Previous Next

Package: coreutils;

Reported by: L A Walsh <coreutils <at> tlinx.org>

Date: Tue, 6 Jul 2021 05:21:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: L A Walsh <coreutils <at> tlinx.org>
To: 49428 <at> debbugs.gnu.org
Subject: bug#49428: RFE: for --time have option to only include contents,  not dir itself.
Date: Mon, 05 Jul 2021 23:56:37 -0700
First stab at a script is really slow...

find dirs, then find all files in the dir:

There's gotta be a faster way...ug!

lastt=1
shopt -s lastpipe

find "$1" -depth -type d |
 while read dr;do
   t=$(find "$dr" -xdev -maxdepth 1 -mindepth 1 ! -name . -a ! -name .. 
-printf "%T@\n" |
       cut -d. -f1|sort -rn|head -1)
   if [[ ! $t ]]; then
     t=$lastt
   fi
   if [[ ! $t ]]; then
     echo "dir=$dr"; exit 1; fi
   #echo "touch -d \"@$t\" \"$dr\""
   touch -d "@$t" "$dr"
   lastt=$t
 done






This bug report was last modified 3 years and 115 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.