diff options
author | Gordon GECOS <u@adam> | 2023-06-01 11:10:05 -0400 |
---|---|---|
committer | Gordon GECOS <u@adam> | 2023-06-01 11:10:05 -0400 |
commit | 67e72130fec97cf31051fb48595b6b94c834054f (patch) | |
tree | 08ef346b77c57cfa931e0902a3460e1e1b9f3b88 | |
parent | 257553276d5040eaed5780e3542beb96fe761f68 (diff) |
new command ssh-shellwrap
-rwxr-xr-x | dot/local/bin/ssh-shellwrap | 19 |
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 | ||
3 | options=() | ||
4 | while [ $# -gt 0 ] | ||
5 | do | ||
6 | case $1 in | ||
7 | -- ) break ;; | ||
8 | esac | ||
9 | options+=("$1") | ||
10 | shift | ||
11 | done | ||
12 | set -e | ||
13 | [ "$1" = '--' ] | ||
14 | shift | ||
15 | [ $# -gt 0 ] | ||
16 | host=$1 | ||
17 | shift | ||
18 | ssh "${options[@]}" -- "$host" ${*@Q} | ||
19 | |||