diff options
author | Jonas Smedegaard <dr@jones.dk> | 2016-10-22 18:13:42 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2016-10-22 18:13:42 +0200 |
commit | 516ec78326293048ecaa4a9ec1b6589d926ae3d3 (patch) | |
tree | 81892ba735bf23ea963b201c82b4b541aff00acc | |
parent | 4f6ddfb335eb1b423e45380acc7029b6d1901dd4 (diff) |
Fix avoid merging arguments.
-rwxr-xr-x | xsh | 25 |
1 files changed, 7 insertions, 18 deletions
@@ -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 |