diff options
author | David Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au> | 2012-11-27 13:02:13 +0800 |
---|---|---|
committer | David Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au> | 2012-11-27 13:02:13 +0800 |
commit | b02ed0bbe64d25cff78d7f19012a34d3d4f21c81 (patch) | |
tree | 6534462032d56c4a39d8cbd77b08f73459325e65 /share/functions/__fish_print_hostnames.fish | |
parent | 165ba535f0ce885d7c1ebc0676a163268912a242 (diff) |
use sgrep instead of grep
Diffstat (limited to 'share/functions/__fish_print_hostnames.fish')
-rw-r--r-- | share/functions/__fish_print_hostnames.fish | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish index 71b8faf6..6f4e6728 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 |