aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2016-02-27 00:32:10 +0100
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-03-02 15:16:52 +0100
commit94c12d84e267bf6603022907e6a791fa596d8c31 (patch)
tree6dbb83475acd6e0eb33df764dd79210e106e60c7
parenta5f5e6c1ef3f8faece23f7bfc2ea0be04cf345c8 (diff)
Stringify reading nfs in print_hostnames
-rw-r--r--share/functions/__fish_print_hostnames.fish4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish
index 094113d4..625b8fa6 100644
--- a/share/functions/__fish_print_hostnames.fish
+++ b/share/functions/__fish_print_hostnames.fish
@@ -15,8 +15,8 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
| 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
- __fish_sgrep </etc/fstab "^\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\|[a-zA-Z.]*\):"|cut -d : -f 1
+ 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 ':.*' ''
end
# Print hosts with known ssh keys