summaryrefslogtreecommitdiff
path: root/xsh
diff options
context:
space:
mode:
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