diff options
author | Jonas Smedegaard <dr@jones.dk> | 2002-03-10 03:55:40 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2002-03-10 03:55:40 +0000 |
commit | 7946251a86c7dafa299ca57e5c1fecec386cad53 (patch) | |
tree | 507be446705d7ed6f3abad643d04912b951bc06c | |
parent | 89e375c6206c0236cfee646fa54aacd6a5fbadca (diff) |
move execute-with-no-options feature from xmc to xsh.
-rwxr-xr-x | xmc | 12 | ||||
-rwxr-xr-x | xsh | 20 |
2 files changed, 15 insertions, 17 deletions
@@ -1,13 +1,3 @@ #!/bin/bash -if [ $# -eq 0 ]; then - xsh - mc -else - if [ $# -eq 1 -a "x$1" = "xsu" ]; then - xsh - mc su -# exec xsh - mc su - else - xsh $@ mc -# exec xsh $@ mc - fi -fi +xsh mc $@ @@ -64,18 +64,26 @@ while [ $# -gt 0 ]; do done set -- $args +# get hostname unless already given or not there if [ -z "$HOST" ]; then - HOST=$1 - shift + if [ $# -gt 1 ]; then + HOST=$1 + shift + else + HOST="localhost" + fi fi if [ -z "$HOST" ]; then usage exit 1 fi -prg_base=$1 -shift -prg_opts=$@ +# Split program name from its options +if [ $# -gt 0 ]; then + prg_base=$1 + shift + prg_opts=$@ +fi if [ "$X" = 1 -a "$SU" = 1 -a "$SUHACK" != 1 ]; then args="root@$args" @@ -93,7 +101,7 @@ if [ "$V" = 1 ]; then fi ## Don't open 2 shells if no program is run - Disabled for now (something wrong with the test...) -#if [ -z "$prg_base" -a -z "$prg_opts" -a $SUU != 1 ]; then +#if [ -z "$prg_base" -a -z "$prg_opts" -a "$SUU" != 1 ]; then # title="$SCRIPT" # prg_local='' # prg_remote='' |