From 516ec78326293048ecaa4a9ec1b6589d926ae3d3 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 22 Oct 2016 18:13:42 +0200 Subject: Fix avoid merging arguments. --- xsh | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/xsh b/xsh index 5164c38..c9a04b4 100755 --- a/xsh +++ b/xsh @@ -7,14 +7,13 @@ usage() { } termwrapper() { - PRG=$@ if [ "$V" = 1 ]; then - echo $PRG + echo "$@" sleep 4 fi - if [ -n "$PRG" ]; then - x-terminal-emulator -e $PRG & + if [ $# -gt 0 ]; then + x-terminal-emulator -e "$@" & else x-terminal-emulator & fi @@ -51,25 +50,15 @@ done [ -z "$SUDO" ] || set -- sudo -i -- "$@" -# Split program name from its options -if [ $# -gt 0 ]; then - prg_base=$1 - shift - prg_opts=$@ -fi - # Pause for a moment if verbose -if [ "$V" = 1 ]; then - prg_opts="$prg_opts; sleep 4" -fi - -prg="$prg_base $prg_opts" +# FIXME: needs shell wrapper (provided by SSH but not in local use) +[ -z "$V" ] || set -- "$@"\; sleep 4 case "$HOST" in '') - termwrapper $prg + termwrapper "$@" ;; *) - termwrapper ssh $ssh_opts $HOST $prg + termwrapper ssh $ssh_opts $HOST "$@" ;; esac -- cgit v1.2.3