diff options
author | Rasmus Steinke <rasi@xssn.at> | 2015-09-16 23:17:38 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2015-09-16 23:17:38 +0200 |
commit | d22a6a1496ecd329ea5c215035f44464d9bdef66 (patch) | |
tree | 8ff5f4040d69a5509d89020456fad6a8fc53a3a7 /clerk | |
parent | e44ec5d68b2834890d5a1ba43fab003b46c97384 (diff) | |
download | perl-app-clerk-d22a6a1496ecd329ea5c215035f44464d9bdef66.tar.gz perl-app-clerk-d22a6a1496ecd329ea5c215035f44464d9bdef66.tar.xz |
use perl for uniqifying
Diffstat (limited to 'clerk')
-rwxr-xr-x | clerk | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -165,8 +165,9 @@ updateCache () { | fix_date_format 1 '%Y-%m-%d-%H:%M:%S' \ | sort -nr \ | gawk '{for (i=2; i<NF; i++) printf $i " "; print $NF}' \ - | uniq \ + | perl -ne 'print unless $seen{$_}++' \ | gawk -F ' — ' '{ print $1 "\t" $2 "\t" $3 }' \ + | uniq \ | gawk -F '\t' '{ printf "%."'${artist_width}'"s\t%."'${date_width}'"s\t%."'${album_width}'"s\n", $1, $2, $3 }' \ | column -s $'\t' -t | uniq > $HOME/.config/clerk/latest.cache # | sed 's,^\([^\t]*\t[^\t]\{40\}\)[^\t]*,\1,' | column -o $'\t' -s $'\t' -t | uniq > $HOME/.config/clerk/latest.cache |