commit 3583fad2618223bd6b2e3c53f31b9339baf43432 (patch) parent f1e3c604e95a1cd2150a792fbe1756939c3d5898 Author: Alex Karle <alex@alexkarle.com> Date: Wed, 21 Apr 2021 00:48:22 -0400 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? Diffstat:
M | jam-tuesday/stats.sh | | | 10 | +++------- |
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git 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 "---------------------------------"