From 9d9ef25b05cb2a6bb0c77531e1db09c25aaa97ff Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Fri, 31 Jan 2020 16:34:03 +0000 Subject: [PATCH] misc/qubes-run-gnome-terminal: avoid external utility (grep) Shave off a few milliseconds. --- misc/qubes-run-gnome-terminal | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/misc/qubes-run-gnome-terminal b/misc/qubes-run-gnome-terminal index 44b448f..bed6905 100755 --- a/misc/qubes-run-gnome-terminal +++ b/misc/qubes-run-gnome-terminal @@ -5,8 +5,7 @@ # Check if our gnome-terminal version supports --wait # (we can't just run it and check exit code, because if it works, it will # return the exit code of the child process) -if gnome-terminal --help-terminal-options | grep --silent -- --wait; then - exec gnome-terminal --wait "$@" -else - exec gnome-terminal "$@" -fi +case "$(gnome-terminal --help-terminal-options)" in + *--wait*) exec gnome-terminal --wait "$@" ;; + *) exec gnome-terminal "$@" ;; +esac