]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bash-completion: use builtins when generating list
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 28 Sep 2015 19:23:04 +0000 (15:23 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 28 Sep 2015 19:23:04 +0000 (15:23 -0400)
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.

shell-completion/bash/networkctl

index 7ca2aa5a81d0a7f66a23e7e4bf55fda9340ce91e..942c7e1c009b786a307444cabc0272bcab54e9e6 100644 (file)
@@ -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() {