Unless what John is trying to do is sort the files from older to newest, I
don't see "-exec " to be an option. If sorting the files is not a
requirement then -exec should be the way to go.

I guess the only way to fix the output for 'ls' is to pipe 'find' results
to 'sed' and escape all the shell special characters, but that'll depend on 
the shell isn't? :)

Regards,

-Urivan Flores


==============Original message text===============
On Sat, 26 Jul 2008 11:01:29 PDT "James G. Sack (jim)" wrote:

SJS wrote:
> begin  quoting David Brown as of Fri, Jul 25, 2008 at 11:32:57AM -0700:
>> On Fri, Jul 25, 2008 at 11:31:10AM -0700, John Oliver wrote:
>>
>>> find /home/ftp -mtime +238 -name \*.mpg | xargs ls -lt
>> If you're using the GNU versions, it's easiest to just use null
>> termination.
>>
>>   find /home/ftp -mtime +238 -name \*.mpg -print0 | xargs -0 ls -lt
>>
> 
> The *easiest* way is to use -exec.
> 
> Complaints about performance of -exec should be ignored, as in that
> case one should use + instead of \; to terminate the -exec option.
> 
> Oh, wait, Linux isn't POSIX compliant with this.

Simple tests show the
  -exec command {} +
syntax seems to work on my F7

find --version
GNU find version 4.2.29
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION SELINUX

Maybe it's (more) POSIIX-compliant now?

> 
> For performance, resort to using a pipe and remembering to use nulls
> as separators.
> 

Regards,
..jim


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
===========End of original message text===========



-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to