diff options
Diffstat (limited to 'xsh')
-rwxr-xr-x | xsh | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -3,7 +3,7 @@ SCRIPT=$(basename $0) usage() { - echo "Usage: $SCRIPT [--x] [--verbose] [[su|sudo] [{user}@]{host}] [-- command...]" + echo "Usage: $SCRIPT [--x] [--verbose] [su|sudo] [[{user}]@{host}] [[--] command...]" } termwrapper() { @@ -42,7 +42,8 @@ while [ $# -gt 0 ]; do --port|-p) ssh_opts="$ssh_opts -p $2"; shift;; --) shift; break;; -*) usage; exit 1;; - *) [ -z "$HOST" ] && HOST=$1 || break;; + *@*|@*) HOST=$1;; + *) break;; esac shift done @@ -88,6 +89,9 @@ case "$HOST" in termwrapper $prg fi ;; + @*) + HOST=$(echo "$HOST" | sed 's/^@//') + ;;& *) if [ -n "$SU" ]; then termwrapper ssh $ssh_opts $HOST $prg_su |