From f73e80c7ad9573b5cc57a0a4e7ca0e825fa24803 Mon Sep 17 00:00:00 2001 From: gryf Date: Sun, 22 Dec 2019 18:40:08 +0100 Subject: [PATCH] Fixed list command --- VBoxManage | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/VBoxManage b/VBoxManage index 7921b34..ee29855 100644 --- a/VBoxManage +++ b/VBoxManage @@ -323,14 +323,10 @@ _VBoxManage() { _list_comp() { local list - list=$(VBoxManage list | \ - grep '|' | \ - sed 's/\[.*\]//g'| \ - sed 's/VBoxManage list//' | \ - tr "\\n" " " | \ - sed 's/$/\n/' | \ - sed 's/\s\+//g' | \ - sed 's/|/ /g') + list=$(VBoxManage list | sed -e '1,2d' \ + -e 's/VBoxManage list //' \ + -e 's/[\[\]\|]/ /g' \ + -e 's/|/ /g'|xargs echo) COMPREPLY=( $(compgen -W "$list" -- ${cur}) ) }