Liste des Groupes | Revenir à cu shell |
Lawrence D'Oliveiro <ldo@nz.invalid> writes:On Sun, 07 Apr 2024 00:01:43 +0000, Javier wrote:
>The downside is the loss of performance because of disk access for>
trivial things like 'nfiles=$(ls | wc -l)'.
Well, you could save one process creation by writing
“nfiles=$(echo * | wc -l)” instead. But that would still not be strictly
correct.
If that saves a process, it's because echo is builtin.
But it will set
$nfiles to 1 (unless you happen to have files with newlines in their
names). Both skip hidden files, which may or may not be what you want.
[...]
Les messages affichés proviennent d'usenet.