Skip to content

tr: fix graph/print character class mapping#11405

Merged
cakebaker merged 2 commits intouutils:mainfrom
can1357:tr-fix-graph-print-character-class-mapping
Mar 26, 2026
Merged

tr: fix graph/print character class mapping#11405
cakebaker merged 2 commits intouutils:mainfrom
can1357:tr-fix-graph-print-character-class-mapping

Conversation

@can1357
Copy link
Copy Markdown
Contributor

@can1357 can1357 commented Mar 18, 2026

uutils tr treats ASCII space as part of [:graph:] and excludes it from [:print:]. Reversing the expected behavior.

Reproduction Steps

printf 'a b\n' | tr -d '[:graph:]' | od -An -t x1
# Expected (GNU): 20 0a
# Actual (uutils): 0a

Impact

Scripts that rely on POSIX/GNU character-class semantics may produce incorrect output. Space handling differs for [:graph:] and [:print:], breaking compatibility with standard filtering behavior in data-cleaning and normalization pipelines.

@cakebaker cakebaker merged commit 358063f into uutils:main Mar 26, 2026
169 of 185 checks passed
@cakebaker
Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants