>> https://savannah.gnu.org/bugs/index.php?51309
>
> Yes, that helps immensely for framing the problem you are trying to solve.
Would you like to look into any more scripts where I got a need
for special handling of file lists?
> 'echo "echo $(ls *txt)"' is inherently slower (and at more risk
> of bugs due to \n in file names, etc) than 'echo *.txt'.
It seems that I constructed a questionable example there.
>>> $ find a -maxdepth 1 \! -type d -printf %f\\n
>>
>> Can it be that this command retrieved more data than necessary just for the
>> display of the basename?
>
> strace it and find out, or read the source (this is open source, after all).
Which source file would be relevant in this case?
I might get also an inappropriate impression from the wording in the manual.
“…
%f File's name with any leading directories removed (only the
last element).
…”
The result of this functionality could fit to my imaginations.
> GNU find invocation outperforms a comparable $(cd dir && echo *txt),
> because it avoids userspace globbing overhead, although I did not try to
> benchmark that to confirm things.
I am curious to know a bit more about such a technical comparison.
Regards,
Markus