[cairo] Test programs extension

Behdad Esfahbod behdad at behdad.org
Thu Dec 7 09:26:26 PST 2006

On Thu, 2006-12-07 at 17:11 +0100, Jean-Baptiste Note wrote:
> Hello,
> The ls *.log trick does not work as bash expands the '*.log' argument
> before passing it to the ls program.
> The standard trick is to use only bash built-ins, for instance this should work:
> echo *.log | xargs rm -f

No, not at all.  The limitation is in the shell, so as long as you have
*.log, it's the same.  The very correct solution is:

  find . -maxdepth 1 -name '*.log' | xargs rm -f

and the very safe solution using GNU tools is:

  find . -maxdepth 1 -name '*.log' -print0 | xargs -0 rm -f

But as I said, I already fixed this problem.  The thread is becoming
really off-topic :).

> xargs takes care of splitting the command-line argument for you.
> JB

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list