On Mon, Nov 30, 2015 at 06:51:02PM +0100, Hiltjo Posthuma wrote: > Something like (quick hack): > > cat historyfile | awk '//{x[$0]++; } END { for (k in x) { print x[k] " > " k; }}' | sort -k 1rn,2 | cut -f 2- | dmenu >> historyfile >
Avoid the death cat!!!. Use something like: awk '{x[$0]++} END {for (k in x) { print x[k],k; }}' historyfile | sort -k 1rn,2 | cut -f 2- | dmenu >> historyfile Regards,