mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
print_hostname: Avoid matches in fstab comments harder
This commit is contained in:
parent
94c12d84e2
commit
65aeaab054
1 changed files with 2 additions and 1 deletions
|
@ -14,9 +14,10 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
|
|||
| string replace -ra '#.*$' '' \
|
||||
| string replace -r '[0-9.]*\s*' '' | string trim | string replace -ra '\s+' '\n'
|
||||
end
|
||||
|
||||
# Print nfs servers from /etc/fstab
|
||||
if test -r /etc/fstab
|
||||
string match -r '^\s*[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3]:|[a-zA-Z\.]*:' </etc/fstab | string replace -r ':.*' ''
|
||||
string match -r '^\s*[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3]:|^[a-zA-Z\.]*:' </etc/fstab | string replace -r ':.*' ''
|
||||
end
|
||||
|
||||
# Print hosts with known ssh keys
|
||||
|
|
Loading…
Reference in a new issue