summaryrefslogtreecommitdiff
path: root/xsh
diff options
context:
space:
mode:
Diffstat (limited to 'xsh')
-rwxr-xr-xxsh8
1 files changed, 6 insertions, 2 deletions
diff --git a/xsh b/xsh
index 2f265ba..67b8edf 100755
--- a/xsh
+++ b/xsh
@@ -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