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
Work incorrectly #26
Comments
The command $ echo -e "foo\nbar\nfoo\nbaz" | hexdump -C
00000000 66 6f 6f 0a 62 61 72 0a 66 6f 6f 0a 62 61 7a 0a |foo.bar.foo.baz.|
$ echo -e "foo\nbar\nfoo\nbaz" | huniq | hexdump -C
00000000 66 6f 6f 0a 62 61 72 0a 62 61 7a 0a |foo.bar.baz.|
$ echo -e "foo\nbar\nfoo\nbaz" | huniq -t | hexdump -C
00000000 66 6f 6f 0a 62 61 72 0a 62 61 7a 0a |foo.bar.baz.| The command $ echo -n -e "foo\nbar\nfoo\nbaz" | hexdump -C
00000000 66 6f 6f 0a 62 61 72 0a 66 6f 6f 0a 62 61 7a |foo.bar.foo.baz|
$ echo -n -e "foo\nbar\nfoo\nbaz" | huniq | hexdump -C
00000000 66 6f 6f 0a 62 61 72 0a 62 61 7a 0a |foo.bar.baz.|
$ echo -n -e "foo\nbar\nfoo\nbaz" | huniq -t | hexdump -C
00000000 66 6f 6f 0a 62 61 72 0a 62 61 7a |foo.bar.baz| Sounds to me like you need to use |
Seems not. I have these tests: test 1: get the font list, then sort the list, and get top 3 from the list fc-list : family | sort -u | head -n 3 and the output:
test 2: get the font list, then sort the list using huniq -t, and get top 3 from the list fc-list : family | huniq -t | head -n 3 the output:
Note that the broken pipe warning seemed to be another problem. The hex dump of the both previous commands: hex dump using fc-list : family | sort -u | head -n 3 | hexdump -C
hex dump using fc-list : family | huniq -t | head -n 3 | hexdump -C
As you can see, both commands produces "line feed seperated" lines, but clearly the 'huniq' didn't sort the list. I've had a thougth about does it using the space as the seperator, and tried using |
Huniq doesn't sort lists; the goal of huniq is not to sort it's output, merely to remove duplicate lines, without sorting them. This is useful because sometimes not touching the output order is actually what you need; on the other hand If you need sorted output you can use the normal |
Thank you for submitting this issue; I am not sure if further action is needed. Feel free to comment if this needs to be reopened. |
The command
fc-list : family | huniq
could not produce the expected result asfc-list : family | sort -u
, and I can confirm that the piped lines are terminated by 0x0a, as the example ofecho -e "foo\nbar\nfoo\nbaz" | huniq
.The text was updated successfully, but these errors were encountered: