summaryrefslogtreecommitdiff
path: root/xsh
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2016-10-22 13:39:11 +0200
committerJonas Smedegaard <dr@jones.dk>2016-10-22 13:54:35 +0200
commit6894d585ff50ed1f48e973f358c5171fb08fa87f (patch)
treea9268a19faa7a35ec253d6fb21576111b2aa1724 /xsh
parent99dcf872d0d77130559f54abe4a367fb1843668d (diff)
Simplify stripping @ from host.
Diffstat (limited to 'xsh')
-rwxr-xr-xxsh6
1 files changed, 2 insertions, 4 deletions
diff --git a/xsh b/xsh
index 9324a6e..1391640 100755
--- a/xsh
+++ b/xsh
@@ -37,7 +37,8 @@ while [ $# -gt 0 ]; do
--port|-p) ssh_opts="$ssh_opts -p $2"; shift;;
--) shift; break;;
-*) usage; exit 1;;
- *@*|@*) HOST=$1;;
+ @*) HOST=${1#@};;
+ *@*) HOST=$1;;
*) break;;
esac
shift
@@ -73,9 +74,6 @@ case "$HOST" in
termwrapper $prg
fi
;;
- @*)
- HOST=$(echo "$HOST" | sed 's/^@//')
- ;;&
*)
if [ -n "$SU" ]; then
termwrapper ssh $ssh_opts $HOST $prg_su