We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We use this to do bash completion on sshgate command, maybe can be usefull:
We define 2 alias in .bash_aliases:
alias sshgate="ssh -Xt sshgate@YOUR_SERVER" alias update_sshgate="ssh sshgate@YOUR_SERVER cmd list targets > ~/.sshgate_list_targets.txt"
And in your .bashrc:
_sshgate_hosts() { local args cur opts COMPREPLY=() argc : parameters number argc=${COMP_CWORD} cur : current word cur="${COMP_WORDS[argc]}" targets list opts="" if [ ! -e ~/.sshgate_list_targets.txt ] then /usr/bin/ssh sshgate@YOUR_SERVER cmd list targets > ~/.sshgate_list_targets.txt fi for i in $(cat ~/.sshgate_list_targets.txt) do opts="$opts $i" done we search $cur in targets list COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) } complete -F _sshgate_hosts sshgate
_sshgate_hosts() { local args cur opts COMPREPLY=()
argc=${COMP_CWORD}
cur="${COMP_WORDS[argc]}"
opts=""
if [ ! -e ~/.sshgate_list_targets.txt ] then /usr/bin/ssh sshgate@YOUR_SERVER cmd list targets > ~/.sshgate_list_targets.txt fi
for i in $(cat ~/.sshgate_list_targets.txt) do opts="$opts $i" done
COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) } complete -F _sshgate_hosts sshgate
An example:
cat ~/.sshgate_list_targets.txt root@server1 root@server2 root@server3 sshg[TAB] sshgate [TAB] sshgate root@server[TAB][TAB] root@server1 root@server2 root@server3
cat ~/.sshgate_list_targets.txt root@server1 root@server2 root@server3
sshg[TAB] sshgate [TAB] sshgate root@server[TAB][TAB] root@server1 root@server2 root@server3
The text was updated successfully, but these errors were encountered:
hi i'm use auto completion for sshgate
in your .bashrc
gatehost=sshg 'cmd list targets' | tr -d $'\r' | sed 's/root@//g' 2>&1 complete -W "$gatehost" sshg complete -o nospace -F _scp -W "$gatehost" scpg
sshg 'cmd list targets' | tr -d $'\r' | sed 's/root@//g' 2>&1
Sorry, something went wrong.
No branches or pull requests
We use this to do bash completion on sshgate command, maybe can be usefull:
We define 2 alias in .bash_aliases:
And in your .bashrc:
An example:
The text was updated successfully, but these errors were encountered: