diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2022-07-10 16:40:43 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2022-07-10 16:40:43 +0100 |
commit | 557a22a101f2177ecadc4ae16cabd64158230b28 (patch) | |
tree | 4d05f94229ffcec610c1b30d580dffbf7076174c /ksh_completion | |
parent | a195a065cc8e13135297b7d5427ce580b4617309 (diff) |
aliases and completion for pass
Diffstat (limited to 'ksh_completion')
-rw-r--r-- | ksh_completion | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ksh_completion b/ksh_completion new file mode 100644 index 0000000..7c4d92f --- /dev/null +++ b/ksh_completion @@ -0,0 +1,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 |