Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uniq: missing support for obsolete +N syntax in place of -s option #7027

Open
jfinkels opened this issue Dec 29, 2024 · 0 comments
Open

uniq: missing support for obsolete +N syntax in place of -s option #7027

jfinkels opened this issue Dec 29, 2024 · 0 comments
Labels

Comments

@jfinkels
Copy link
Collaborator

The obsolete syntax +N for skipping bytes (superseded by the -s N option) is currently not supported in uutils uniq.

uutils uniq:

$ printf "aaa\nbaa\n" | ./target/debug/uniq +1
./target/debug/uniq: Could not open +1: No such file or directory

GNU uniq:

$ printf "aaa\nbaa\n" | uniq +1
aaa

Notes: Here is the documentation from info uniq:

‘-s N’
‘--skip-chars=N’
     Skip N characters before checking for uniqueness.  Use a null
     string for comparison if a line has fewer than N characters.  If
     you use both the field and character skipping options, fields are
     skipped over first.

     On systems not conforming to POSIX 1003.1-2001, ‘uniq’ supports a
     traditional option syntax ‘+N’.  Although this traditional behavior
     can be controlled with the ‘_POSIX2_VERSION’ environment variable
     (*note Standards conformance::), portable scripts should avoid
     commands whose behavior depends on this variable.  For example, use
     ‘uniq ./+10’ or ‘uniq -s 10’ rather than the ambiguous ‘uniq +10’.

This is causing a test failure in the GNU test file tests/uniq/uniq.pl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant