Re: [hackers] [dmenu][RFC][PATCH 0/4] Using sort and simple C program to get dmenu history functionality

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Tue, 1 Dec 2015 07:38:34 +0100

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,
Received on Tue Dec 01 2015 - 07:38:34 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 01 2015 - 07:48:12 CET