Use alpha ordering for function definitions

This commit is contained in:
William Melody 2015-03-18 15:45:23 -07:00
parent f7ed234951
commit a8461f48fd
1 changed files with 20 additions and 20 deletions

40
hosts
View File

@ -660,26 +660,6 @@ add() {
fi
}
# ------------------------------------------------------------------------ list
desc list <<EOM
Usage:
$_me list [127.]
Description:
List the existing IP / hostname pairs. When provided with the beginning of
an IP address, lists the pairs with matching IP addresses.
EOM
list() {
if [[ -n "$1" ]]; then
grep "^$1" /etc/hosts
else
# NOTE: use separate expressions since using a | for the or results in
# inconsistent behavior.
grep -v -e '^$' -e '^\s*\#' /etc/hosts
fi
}
# ------------------------------------------------------------------------ edit
desc edit <<EOM
@ -710,6 +690,26 @@ file() {
cat /etc/hosts
}
# ------------------------------------------------------------------------ list
desc list <<EOM
Usage:
$_me list [127.]
Description:
List the existing IP / hostname pairs. When provided with the beginning of
an IP address, lists the pairs with matching IP addresses.
EOM
list() {
if [[ -n "$1" ]]; then
grep "^$1" /etc/hosts
else
# NOTE: use separate expressions since using a | for the or results in
# inconsistent behavior.
grep -v -e '^$' -e '^\s*\#' /etc/hosts
fi
}
# ---------------------------------------------------------------------- remove
desc remove <<EOM