bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Feat-Req: uniq -c delimiter should be changable


From: Maximilian Haeussler
Subject: Feat-Req: uniq -c delimiter should be changable
Date: Sat, 17 May 2008 16:36:30 +0200

Hi gurus,

uniq -c uses space to separate counts from lines since 2003, as this is
required by posix. I understand that you want to stay compatible with posix,
but why is there not option to change this behaviour, to make uniq behave
like cut or sort? This would make combining uniq -c with tools like gawk,
sort or cut much easier. Patrick Tufts already proposed this (I only found
it here:
http://www.opensubscriber.com/message/address@hidden/5107663.html)
and Bob Proulx wanted examples, so here is my standard example:

Let's say I only want the 50 most common lines of a file:
cat textfile | sort | uniq -c | sort -n | tail -n 50 | tr -s ' ' | cut -f2

This will only print the first word of each line with the current uniq
version though if uniq -c understood -d/-t it would print the whole

This is just a proposition for a feature that would make uniq more
homogenous. Debian documents that "--separator" was actually patched into
the debian version of uniq in the coreutils package, but the patch has been
removed, I guess the coreutils developers at the time didn't find this
change useful enough.

Is there any good reason not to include such an option?

thanks
Max


reply via email to

[Prev in Thread] Current Thread [Next in Thread]