mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 01:48:08 +08: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
@ -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…
x
Reference in New Issue
Block a user