aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2016-02-27 14:33:03 +0100
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-03-02 15:16:52 +0100
commit65aeaab0545cef840daee0c64de8ac763ae2e4a8 (patch)
tree8661ecfa858f887c107dec2bb563bff58a88de4a /share/functions
parent94c12d84e267bf6603022907e6a791fa596d8c31 (diff)
print_hostname: Avoid matches in fstab comments harder
Diffstat (limited to 'share/functions')
-rw-r--r--share/functions/__fish_print_hostnames.fish3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish
index 625b8fa6..4910d3f8 100644
--- a/share/functions/__fish_print_hostnames.fish
+++ b/share/functions/__fish_print_hostnames.fish
@@ -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