Remix.run Logo
dspillett 5 hours ago

> not strictly necessary to use -1 as I believe all common ls detect !isatty(stdout)

I remember, though from the dim an distant past so it could be a long-fixed bug, this not working in at least one circumstance. I've explicitly included -1 in scripted calls to ls since. Of course we are breaking the best practice rule of not trying to parse the output of ls, so problems are not unexpected…

As a generally thing I like to include directives like this in scripted calls even if they happen by default anyway, because is makes my intent clear: I expect the output to being in simple single-column format and the rest will break if it isn't. I even sometimes go as far as specifying --sort=name if nothing else in the pipeline is going to enforce that.

> as long as your xargs has -0 support

I don't think I've encountered an xargs that doesn't have this support for a long time, though I don't work with embedded stuff so maybe there are cut-down versions out there still in active use for space reasons.

The problem I've hit numerous times is wanting to do something between “find -print0” and “xargs -0” and that something not supporting NUL as the item delimiter.

dundarious 2 hours ago | parent [-]

I don't remember which was the odd one out, but in the 00s I was using Mac OS X and FreeBSD (and maybe some other more niche alternatives) a lot, and something didn't support xargs -0.