iankelling.org
/
git
/
distro-setup
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
79b274f
)
fix ssh wrapper
author
Ian Kelling
<ian@iankelling.org>
Wed, 23 Oct 2019 22:14:04 +0000
(18:14 -0400)
committer
Ian Kelling
<ian@iankelling.org>
Wed, 23 Oct 2019 22:14:04 +0000
(18:14 -0400)
brc2
patch
|
blob
|
history
diff --git
a/brc2
b/brc2
index 973da7a201f21e2e55a1d0c8695660ca52b32edb..2bfb6775fc43c4c8f25ddb2ea61880336e891713 100644
(file)
--- a/
brc2
+++ b/
brc2
@@
-938,13
+938,21
@@
sl() {
# Theres a couple ways to do this. im not sure whats best,
# but relying on bash 4.4+ escape quoting seems most reliable.
command ssh "${args[@]}" "$remote" \
# Theres a couple ways to do this. im not sure whats best,
# but relying on bash 4.4+ escape quoting seems most reliable.
command ssh "${args[@]}" "$remote" \
- BRC=t bash -c '"\"\$@\""' bash ${@@Q}
+ BRC=t bash -c '.\ .iank/.bashrc\;"\"\$@\""' bash ${@@Q}
+ elif [[ ! -t 0 ]]; then
+ # This case is when commands are being piped to ssh.
+ # Normally, no bashrc gets sourced.
+ # But, since we are doing all this, lets source it because we can.
+ cat <(echo . .iank/.bashrc) - | command ssh "${args[@]}" "$remote" BRC=t bash
else
else
- # -t gives us an interactive shell for normal ssh. -l makes us use the rcfile when piping commands.
- command ssh -t "${args[@]}" "$remote" BRC=t INPUTRC=.iank/.inputrc bash --rcfile .iank/.bashrc -l
+ command ssh -t "${args[@]}" "$remote" BRC=t INPUTRC=.iank/.inputrc bash --rcfile .iank/.bashrc
fi
else
fi
else
- BRC=t command ssh "$remote" "$@"
+ if [[ -t 0 ]]; then
+ BRC=t command ssh "${args[@]}" "$remote" ${@@Q}
+ else
+ command ssh "${args[@]}" "$remote" BRC=t bash -l
+ fi
fi
}
sss() { # ssh solo
fi
}
sss() { # ssh solo