From 3583fad2618223bd6b2e3c53f31b9339baf43432 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Wed, 21 Apr 2021 00:48:22 -0400 Subject: [PATCH] jam-tuesday: Fix stats.sh on OpenBSD No need for the wc -l | cut, since no filename printed if wc reads standard input. Also, 4 space alignment instead of 7? --- jam-tuesday/stats.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/jam-tuesday/stats.sh b/jam-tuesday/stats.sh index 4b44cf8..f164b37 100755 --- a/jam-tuesday/stats.sh +++ b/jam-tuesday/stats.sh @@ -23,15 +23,11 @@ topN() { sort -n -r | head -n "$N" } -count() { - wc -l | cut -d' ' -f 1 -} - echo "Play Stats:" echo "-----------" -printf "%7d Songs Total\\n" "$(count < "$TMP")" -printf "%7d Unique Songs\\n" "$(songs | count)" -printf "%7d Unique Artists\\n\\n" "$(artists | count)" +printf "%4d Songs Total\\n" "$(wc -l < "$TMP")" +printf "%4d Unique Songs\\n" "$(songs | wc -l)" +printf "%4d Unique Artists\\n\\n" "$(artists | wc -l)" echo "Top $N Artists (Frequency, Name):" echo "---------------------------------" -- libgit2 1.1.1