comm in Shell Pipelines: Compare Sets Only After Sorting Consistently
Use comm for line-set differences only when both inputs share a locale, ordering, record, duplicate policy, and stable input framing.
tag
6 posts
Use comm for line-set differences only when both inputs share a locale, ordering, record, duplicate policy, and stable input framing.
Use cut only for the record format it understands, distinguishing bytes, characters, fields, locale effects, and arbitrary filename boundaries.
Make sort results reproducible by defining locale, key boundaries, numeric semantics, stability, and temporary-storage behavior.
Use tr for character translation, squeezing, and deletion without assuming Unicode normalization, multibyte portability, or arbitrary-byte semantics.
Configure and verify Linux locales in WSL without confusing UTF-8 bytes, Windows console settings, terminal rendering, and application decoding.
Mojibake, invalid byte errors, and inconsistent sorting usually come from a locale mismatch - diagnose bytes and locale variables before converting anything.