]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
zsh-completion: remove non-portable uses of \s in awk (#3063)
authorFelipe Sateler <fsateler@users.noreply.github.com>
Tue, 19 Apr 2016 04:23:01 +0000 (01:23 -0300)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 Apr 2016 04:23:01 +0000 (00:23 -0400)
shell-completion/zsh/_coredumpctl
shell-completion/zsh/_networkctl

index 833c7e2bb1b96a7e262eacdb01607be1e99b11bb..e4c04a697fa639b0ed59130a91357de86088d3b5 100644 (file)
@@ -16,7 +16,7 @@ _coredumpctl_command(){
         cmd="${${_coredumpctl_cmds[(r)$words[1]:*]%%:*}}"
         if (( $#cmd  )); then
             # user can set zstyle ':completion:*:*:coredumpctl:*' sort no for coredumps to be ordered by date, otherwise they get ordered by pid
-            _dumps=( "${(foa)$(coredumpctl list | awk 'BEGIN{OFS=":"} /^\s/ {sub(/[[ \t]+/, ""); print $5,$0}' 2>/dev/null)}" )
+            _dumps=( "${(foa)$(coredumpctl list --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $5,$0}' 2>/dev/null)}" )
             if [[ -n "$_dumps" ]]; then
                 _describe -t pids 'coredumps' _dumps
             else
index a47e967f660e8be15326baf0f8cc62c267ac197b..61f173b78e9630dae87a24623451022db642a325 100644 (file)
@@ -14,7 +14,7 @@ _networkctl_command(){
         local -a _links
         cmd="${${_networkctl_cmds[(r)$words[1]:*]%%:*}}"
         if [ $cmd = "status" ]; then
-            _links=( "${(foa)$(networkctl list --no-legend | awk 'BEGIN{OFS=":"} /^\s/ {sub(/[[ \t]+/, ""); print $2,$0}' 2>/dev/null)}" )
+            _links=( "${(foa)$(networkctl list --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $2,$0}' 2>/dev/null)}" )
             if [[ -n "$_links" ]]; then
                 _describe -t links 'links' _links
             else