mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Ignore hashed host names in ssh/known_hosts
Valid DNS names cannot have a | character and hashed ssh hosts always begin with the | character. Therefore we ignore lines that begin with |. Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
This commit is contained in:
parent
2626b83b08
commit
d38f1380e9
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
|
|||
end
|
||||
|
||||
# Print hosts with known ssh keys
|
||||
cat ~/.ssh/known_hosts{,2} ^/dev/null|cut -d ' ' -f 1| cut -d , -f 1
|
||||
cat ~/.ssh/known_hosts{,2} ^/dev/null | grep -v '^|' | cut -d ' ' -f 1| cut -d , -f 1
|
||||
|
||||
# Print hosts from ssh configuration file
|
||||
if [ -e ~/.ssh/config ]
|
||||
|
|
Loading…
Reference in a new issue