summaryrefslogtreecommitdiff
path: root/xsh
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2016-10-22 18:13:42 +0200
committerJonas Smedegaard <dr@jones.dk>2016-10-22 18:13:42 +0200
commit516ec78326293048ecaa4a9ec1b6589d926ae3d3 (patch)
tree81892ba735bf23ea963b201c82b4b541aff00acc /xsh
parent4f6ddfb335eb1b423e45380acc7029b6d1901dd4 (diff)
Fix avoid merging arguments.
Diffstat (limited to 'xsh')
-rwxr-xr-xxsh25
1 files 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