diff --git a/Readme.md b/Readme.md index 90d41e4..222b4ee 100644 --- a/Readme.md +++ b/Readme.md @@ -7,7 +7,7 @@ A command line program with shortcuts for managing hosts file entries. Usage: hosts add hosts remove - hosts list [127.] + hosts list [] hosts edit hosts file diff --git a/hosts b/hosts index 1469184..5b29f9e 100755 --- a/hosts +++ b/hosts @@ -702,7 +702,7 @@ Description: EOM list() { if [[ -n "$1" ]]; then - grep "^$1" /etc/hosts + grep "^[^#]*$1" /etc/hosts else # NOTE: use separate expressions since using a | for the or results in # inconsistent behavior.