summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon GECOS <u@adam>2023-06-01 11:10:05 -0400
committerGordon GECOS <u@adam>2023-06-01 11:10:05 -0400
commit67e72130fec97cf31051fb48595b6b94c834054f (patch)
tree08ef346b77c57cfa931e0902a3460e1e1b9f3b88
parent257553276d5040eaed5780e3542beb96fe761f68 (diff)
new command ssh-shellwrap
-rwxr-xr-xdot/local/bin/ssh-shellwrap19
1 files changed, 19 insertions, 0 deletions
diff --git a/dot/local/bin/ssh-shellwrap b/dot/local/bin/ssh-shellwrap
new file mode 100755
index 0000000..e0d537e
--- /dev/null
+++ b/dot/local/bin/ssh-shellwrap
@@ -0,0 +1,19 @@
1#!/bin/bash
2# ssh wrapper; requires "--" before host argument
3options=()
4while [ $# -gt 0 ]
5do
6 case $1 in
7 -- ) break ;;
8 esac
9 options+=("$1")
10 shift
11done
12set -e
13[ "$1" = '--' ]
14shift
15[ $# -gt 0 ]
16host=$1
17shift
18ssh "${options[@]}" -- "$host" ${*@Q}
19