Re: [dev] [sbase] [patch] Optimize 'ls' and add '-U'

From: Thorsten Glaser <tg_AT_mirbsd.de>
Date: Mon, 22 Jul 2013 21:37:20 +0000 (UTC)

Chris Down dixit:

>If you really care, any POSIX shell should be able to do this as long
>as you don't hit ARG_MAX:
>
> set -- * && echo "$#"

I think ARG_MAX may not be relevant here… but globbing * usually
sorts, and shells don’t always use the fastest algorithms…

… but OTOH, if you have that large directories, you have all
sorts of other problems. “DDTT” and “KISS”, while not always
available, are good suggestions ;-)

bye,
//mirabilos
-- 
“It is inappropriate to require that a time represented as
 seconds since the Epoch precisely represent the number of
 seconds between the referenced time and the Epoch.”
	-- IEEE Std 1003.1b-1993 (POSIX) Section B.2.2.2
Received on Mon Jul 22 2013 - 23:37:20 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 22 2013 - 23:48:05 CEST