From 6c9e20617f3fb9798024992b5be0761152f73b7d Mon Sep 17 00:00:00 2001 From: lemniskett Date: Wed, 11 Nov 2020 10:51:06 +0700 Subject: [PATCH] Another way to escape spaces in command. --- archbox.bash | 3 +-- archboxcommand.bash | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/archbox.bash b/archbox.bash index b980f85..0b4bff2 100755 --- a/archbox.bash +++ b/archbox.bash @@ -100,7 +100,6 @@ case $1 in *) storeenv copyresolv - COMMAND=$(echo $@ | tr ' ' '\ ') - $PRIV /usr/local/share/archbox/bin/archbox $COMMAND + $PRIV /usr/local/share/archbox/bin/archbox $@ ;; esac diff --git a/archboxcommand.bash b/archboxcommand.bash index 7417928..0b99948 100755 --- a/archboxcommand.bash +++ b/archboxcommand.bash @@ -5,7 +5,6 @@ source /etc/archbox.conf REQ_ENV="DBUS_SESSION_BUS_ADDRESS=$(cat /tmp/archbox_dbus_session_address) XDG_RUNTIME_DIR=$(cat /tmp/archbox_xdg_runtime_dir)" ENV="$REQ_ENV $ENV_VAR" - -COMMAND=$(echo $@ | tr ' ' '\ ') +COMMAND="$@" [[ $1 = "enter" ]] && (chroot $CHROOT /sbin/env $ENV /bin/su $USER; exit 0) \ || chroot $CHROOT /bin/su -c "env $ENV $COMMAND" $USER