summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2016-04-15 22:24:26 +0200
committerJonas Smedegaard <dr@jones.dk>2016-04-15 22:40:20 +0200
commitdf28c867f2fe4319cefba087490e3210a13fbd46 (patch)
tree92b17f26044d5804cb16db70a3162b3a5352a77a
parent07ed5db45f0eb0568d2ab53c42f2726e36be6034 (diff)
Tidy: Rewrite compactclist() to be more compact (no pun intended).
-rwxr-xr-xlocaldebpool5
1 files changed, 1 insertions, 4 deletions
diff --git a/localdebpool b/localdebpool
index a2cd506..e6723a4 100755
--- a/localdebpool
+++ b/localdebpool
@@ -19,10 +19,7 @@ debugprint() {
}
compactlist() {
- ( for item in $@; do echo $item; done ) \
- | sort -u \
- | tr '\n' ' ' \
- | sed 's/[[:space:]]\+/ /g; s/^[[:space:]]//; s/[[:space:]]$//'
+ echo "$*" | perl -nlE "say for /(\S+)/g" | sort -u
}
regexfromlist() {