Re: trying to optimize find's searches ...
On Sat 05 Mar 2016 at 05:23:55 (+0000), Albretch Mueller wrote:
> find works significantly faster when you bag various search patterns á la:
>
> -iname '*.ko' -or -iname '*.bin' -or -iname '*.txt'
>
> but, how could you do that using a batch strategy and setting a
> variable with many "-[i]name ... -or -[i]name ..." cases?
>
> line-by-line strategies are too slow
>
> lbrtchx
Eh?
local CMD="command -opt value ..."
loop
CMD="$CMD -more options ..."
...
# Having built the full command:
echo $CMD
#eval $CMD
Is that the sort of thing? Quoting can become a bit of a challenge.
As shown, you'll probably need to
echo $CMD
rather than
eval $CMD
while you test whether it's all put together right.
Cheers,
David.
Reply to: