From b02ed0bbe64d25cff78d7f19012a34d3d4f21c81 Mon Sep 17 00:00:00 2001 From: "David Adam (zanchey)" Date: Tue, 27 Nov 2012 13:02:13 +0800 Subject: [PATCH] use sgrep instead of grep --- share/functions/__fish_print_hostnames.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish index 71b8faf6e..6f4e6728f 100644 --- a/share/functions/__fish_print_hostnames.fish +++ b/share/functions/__fish_print_hostnames.fish @@ -5,7 +5,7 @@ function __fish_print_hostnames -d "Print a list of known hostnames" if test -x /usr/bin/getent getent hosts | tr -s ' ' ' ' | cut -d ' ' -f 2- | tr ' ' '\n' elseif test -f /etc/hosts - tr -s ' \t' ' ' < /etc/hosts | sed 's/ *#.*//' | cut -s -d ' ' -f 2- | grep -o '[^ ]*' + tr -s ' \t' ' ' < /etc/hosts | sed 's/ *#.*//' | cut -s -d ' ' -f 2- | sgrep -o '[^ ]*' end # Print nfs servers from /etc/fstab if test -f /etc/fstab @@ -17,7 +17,7 @@ function __fish_print_hostnames -d "Print a list of known hostnames" # Print hosts from ssh configuration file if [ -e ~/.ssh/config ] - grep '^ *Host' ~/.ssh/config | grep -v '[*?]' | cut -d ' ' -f 2 + sgrep '^ *Host' ~/.ssh/config | grep -v '[*?]' | cut -d ' ' -f 2 end end