sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

D1760.fzf-completion-reduced.sh (1424B)


      1 
      2 _fzf_host_completion () {
      3   _fzf_complete +m -- "$@" < <(
      4     command cat <(
      5       command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2> /dev/null |
      6         command grep -i '^\s*host\(name\)\? ' |
      7         awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' |
      8         command grep -v '[*?]'
      9     ) <(
     10       command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts |
     11         tr ',' '\n' |
     12         tr -d '[' |
     13         awk '{ print $1 " " $1 }'
     14     ) <(
     15       command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0'
     16     ) | awk '{if (length($2) > 0) {print $2}}' | sort -u
     17   )
     18 }
     19 
     20 
     21 function generate1 {
     22   {
     23     command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2> /dev/null |
     24       command grep -i '^\s*host\(name\)\? ' |
     25       awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' |
     26       command grep -v '[*?]'
     27     command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts |
     28       tr ',' '\n' |
     29       tr -d '[' |
     30       awk '{ print $1 " " $1 }'
     31     command grep -v '^\s*\(#\|$\)' /etc/hosts |
     32       command grep -Fv '0.0.0.0'
     33   } | awk '{if (length($2) > 0) {print $2}}' | sort -u
     34 }
     35 
     36 function generate2 {
     37   cat <<EOF
     38 aur.archlinux.org
     39 bitbucket.org
     40 chat
     41 chatoyancy.home
     42 front1
     43 gell-mann
     44 github.com
     45 gitlab.com
     46 hankel
     47 hp2019
     48 laguerre
     49 ln25
     50 localhost
     51 mag
     52 magnate
     53 magnate2016
     54 magnate2016.home
     55 magnate2018.home
     56 mercury
     57 neumann
     58 pad
     59 padparadscha
     60 padparadscha.home
     61 song123
     62 tkynt2
     63 tkyntn
     64 EOF
     65 }