tFix input file name and argument check - bitreich-memestats - statistical analysis of tags in Freenode/#bitreich-en
(HTM) git clone git://src.adamsgaard.dk/bitreich-memestats
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 0086f47923e36075b7a20fa4a01a4ae618360876
(DIR) parent 821d218576745d7ad82ea81c18da04197ebc4c84
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Mon, 20 Apr 2020 10:19:44 +0200
Fix input file name and argument check
Diffstat:
M plot-memecount.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
(DIR) diff --git a/plot-memecount.sh b/plot-memecount.sh
t@@ -1,21 +1,21 @@
#!/bin/sh
# output ascii plot of hashtag evolution generated with extract-memecount.sh
-if [ $# -ne 1 ]; then
- printf 'usage: %s <file>\n' "$1" >&2
+if [ $# -lt 1 ]; then
+ printf 'usage: %s <file>\n' "$0" >&2
exit 1
-}
+fi
[ "$2" = "semilog" ] && semilog="set log y"
gnuplot - <<__EOF__
set term dumb
set title "annna meme count (total on $(date +%Y-%m-%d): \
-$(tail -1 "$statfile" | awk '{print $3}'))"
+$(tail -1 "$1" | awk '{print $3}'))"
set xdata time
set format x "%Y-%m"
set timefmt "%Y-%m-%dT%H:%M:%S"
set xtics 2592000*4
$semilog
-plot '$statfile' u 1:3 w lp t '' pt 13
+plot '$1' u 1:3 w lp t '' pt 13
__EOF__