in reply to Logging deleted files

find ... | perl -ne 'print join(" ", time, $_)' | tee [-a] logfile | awk '{print $NF}' | xargs /bin/rm -f

or

find ... | perl -ne 'chomp; unlink && print join(" ", time, $_), "\n"' | tee [-a] logfile

--MidLifeXis

Replies are listed 'Best First'.
Re^2: Logging deleted files
by ppantazis (Initiate) on Oct 18, 2007 at 21:41 UTC
    when I try this for some reason time comes out as a very long string of digits some huge num_seconds or something. Does perl have a problem with time?

      See the perldoc for time

      --MidLifeXis

        MidLifeXis, thanks, I did look at this and how I interpret it is that you must have something along the lines of localtime(time). For example, find /tmp/TopLevelDir/SunDir -name 'blah.*' -maxdepth 1 | perl -ne 'chomp; unlink && print localtime(time)." $_\n" | tee -a logfile However, when I run this from the command line I get the a prompt like: > I think I am getting closer but I must be missing something. I will keep playing around with it.