From 3da59131e3e74d493c9e28589d79569a3dad668d Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 7 May 2017 00:52:54 +0200 Subject: Tidy variable HEIGHTS: Generalize function uniqwords. --- bin/stream | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/stream b/bin/stream index 0d46904..6e8e069 100755 --- a/bin/stream +++ b/bin/stream @@ -93,8 +93,11 @@ printf_each() { printf "$skel" "$string" done } +uniqwords() { + echo "$@" | tr ' ' '\012' | sort -u +} -HEIGHTS=$(echo "$HEIGHTS_WEBM $HEIGHTS_MPEG" | tr ' ' '\012' | sort -u) +HEIGHTS=$(uniqwords "$HEIGHTS_WEBM $HEIGHTS_MPEG") HEIGHTCOUNT=$(echo "$HEIGHTS" | wc --words) # FIXME: support multiple heights -- cgit v1.2.3