summaryrefslogtreecommitdiffstats
path: root/ksh_completion
blob: 7c4d92fc85b11303ebe259947e36782c09f643eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
set -A SSH_KNOWN_HOSTS ~/.ssh/known_hosts

if [ -f /etc/ssh/ssh_known_hosts ]; then
    SSH_KNOWN_HOSTS="${SSH_KNOWN_HOSTS[@]} /etc/ssh/ssh_known_hosts"
fi

#HOST_LIST=$(awk '{split($1,a,","); gsub("].*", "", a[1]); gsub("\[", "", a[1]); print a[1] " root@" a[1]}' $SSH_KNOWN_HOSTS | sort | uniq)
HOST_LIST=$(awk '{split($1,a,","); print a[1] " root@" a[1]}' $SSH_KNOWN_HOSTS | sort | uniq)

set -A complete_ssh -- $HOST_LIST
set -A complete_scp -- $HOST_LIST

PASS_ITEMS=$(find /home/lemon/.password-store/ | awk -F'/' '{ print $(NF) }' | awk -F '.gpg' '{ print $1 }')
set -A complete_pass -- $PASS_ITEMS