From a5b2c91c93c0f8a1b51b09563efc554a7cce87f0 Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Tue, 24 Nov 2015 13:15:31 +0000 Subject: [PATCH] Quote the variables in i3-sensible-* correctly Previously, the variables $EDITOR, $PAGER, $TERMINAL and $VISUAL got shell-expanded twice before executing them. --- i3-sensible-editor | 6 +++--- i3-sensible-pager | 6 +++--- i3-sensible-terminal | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/i3-sensible-editor b/i3-sensible-editor index 4e7456b7..861615f3 100755 --- a/i3-sensible-editor +++ b/i3-sensible-editor @@ -9,8 +9,8 @@ # mechanism to find the preferred editor # Hopefully one of these is installed (no flamewars about preference please!): -for editor in $VISUAL $EDITOR nano vim vi emacs pico qe mg jed gedit mc-edit; do - if command -v $editor > /dev/null 2>&1; then - exec $editor "$@" +for editor in "$VISUAL" "$EDITOR" nano vim vi emacs pico qe mg jed gedit mc-edit; do + if command -v "$editor" > /dev/null 2>&1; then + exec "$editor" "$@" fi done diff --git a/i3-sensible-pager b/i3-sensible-pager index ce71686b..386e2988 100755 --- a/i3-sensible-pager +++ b/i3-sensible-pager @@ -11,8 +11,8 @@ # Hopefully one of these is installed (no flamewars about preference please!): # We don't use 'more' because it will exit if the file is too short. # Worst case scenario we'll open the file in your editor. -for pager in $PAGER less most w3m pg i3-sensible-editor; do - if command -v $pager > /dev/null 2>&1; then - exec $pager "$@" +for pager in "$PAGER" less most w3m pg i3-sensible-editor; do + if command -v "$pager" > /dev/null 2>&1; then + exec "$pager" "$@" fi done diff --git a/i3-sensible-terminal b/i3-sensible-terminal index c80e5ee2..bb66f02b 100755 --- a/i3-sensible-terminal +++ b/i3-sensible-terminal @@ -8,9 +8,9 @@ # We welcome patches that add distribution-specific mechanisms to find the # preferred terminal emulator. On Debian, there is the x-terminal-emulator # symlink for example. -for terminal in $TERMINAL x-terminal-emulator urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal termite lxterminal mate-terminal terminology; do - if command -v $terminal > /dev/null 2>&1; then - exec $terminal "$@" +for terminal in "$TERMINAL" x-terminal-emulator urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal termite lxterminal mate-terminal terminology; do + if command -v "$terminal" > /dev/null 2>&1; then + exec "$terminal" "$@" fi done -- 2.39.5