mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
use sgrep instead of grep
This commit is contained in:
parent
165ba535f0
commit
b02ed0bbe6
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue