logoalt Hacker News

MrDOStoday at 11:21 AM1 replyview on HN

I think the parent was referring to using awk/sed to do the equivalent of:

    find ... | tr '\n' '\0' | xargs -0 ...
I.e., a blind replacement without the tool having any particular semantic understanding of what it's translating.

That still requires your xargs to have -0 support, though, and I'd be surprised to have that without the corresponding option on find. But I've done this before when feeding xargs from something other than find.


Replies

mr_mitmtoday at 3:16 PM

It is also built on the assumption that filenames never contain newlines, which is wrong in general.

It's baffling to me that POSIX allows non-printable characters in file names, but here we are. Surely they had a reason for this decision.