summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-05-07 00:52:54 +0200
committerJonas Smedegaard <dr@jones.dk>2017-05-07 00:52:54 +0200
commit3da59131e3e74d493c9e28589d79569a3dad668d (patch)
tree4a8ce0d9119a99425fa7de020c59a22c43033526
parent0d01c144a85c59fdf2cd0fe7bd93c346b0c6f438 (diff)
Tidy variable HEIGHTS: Generalize function uniqwords.
-rwxr-xr-xbin/stream5
1 files changed, 4 insertions, 1 deletions
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