On Thu, Aug 25, 2022 at 10:10:46PM -0700, L A Walsh wrote:
there's more to life than coreutils
-----
But the OP was posting about inconsistencies in coreutils.
What you are saying is because coreutils is broken/inconsistent, use
'find'.
For programmatic use, definitely. When someone's trying to pound a
square peg into a round hole it's rarely helpful for them to make one
corner a little rounder (for their particular definition of "more
round") because it's still going to be a peg that's the wrong shape.
find isn't consistent. If you specify '.' as a starting dir, all output is
prefixed with
'./'
If you leave off the starting dir you still get './' as a prefix instead of a
null prefix.
Even if you try a null dir as a starting point '', you still can't get
your listing without './' prepended.
sounds extremely consistent to me. there is no "null prefix"; per the
docs, if no starting point is specified then . is assumed.
also, find /dir -type f -printf '%f\n'
find is intended for programmatic use, so its output can be tailored to
meet particular requirements. I suspect the above still isn't the best
answer unless the requirement is actually "print filenames without
directories" but it does what it says.