summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-09-28 15:23:04 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-09-28 15:23:04 -0400
commitb00c1cf9d61ccd9b0f7bc131f01d80bb5736af0d (patch)
treed53c3264ba1c9fca3414e73532a9408ca1f9d5cf
parent840b2c0e77911bef3056f358b8d16a3253e4ab70 (diff)
bash-completion: use builtins when generating list
awk is an external program, and it is better to stick to shell built-ins. Also, even with external awk, sort -u is redundant, because the shell does this on its own.
-rw-r--r--shell-completion/bash/networkctl2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell-completion/bash/networkctl b/shell-completion/bash/networkctl
index 7ca2aa5a81..942c7e1c00 100644
--- a/shell-completion/bash/networkctl
+++ b/shell-completion/bash/networkctl
@@ -24,7 +24,7 @@ __contains_word () {
}
__get_links() {
- networkctl list --no-legend --no-pager --all | awk '{ print $2 }' | sort -u
+ networkctl list --no-legend --no-pager --all | { while read -r a b c; do echo " $b"; done; };
}
_networkctl() {