mirror of
https://github.com/octoleo/hosts.git
synced 2024-11-24 13:47:35 +00:00
Group helper variables and functions in Helpers section.
This commit is contained in:
parent
0ce875c210
commit
0201480ffb
24
hosts
24
hosts
@ -71,17 +71,6 @@ HOSTS_DEFAULT_SUBCOMMAND="${HOSTS_DEFAULT_SUBCOMMAND:-list}"
|
||||
# The path to the hosts file. This will almost always be /etc/hosts
|
||||
HOSTS_PATH="${HOSTS_PATH:-/etc/hosts}"
|
||||
|
||||
# Space and tab for regular expressions
|
||||
#
|
||||
# sed regular expressions have slightly different behaviors dependending on
|
||||
# the environment, and POSIX [[:space:]] matches whitespace characters other
|
||||
# than just space and tab. These variables provide an easier, portable way to
|
||||
# test for just these two characters.
|
||||
export _TAB_=$'\t'
|
||||
export _SPACE_=$' '
|
||||
export _TAB_SPACE_="${_TAB_}${_SPACE_}"
|
||||
export _TAB_SPACE_CC_="[${_TAB_SPACE_}]"
|
||||
|
||||
# $_REPO
|
||||
#
|
||||
# The <user>/<repo> identifier for the git repository.
|
||||
@ -173,9 +162,20 @@ _warn() {
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Utility Functions
|
||||
# Helpers
|
||||
###############################################################################
|
||||
|
||||
# Space and tab for regular expressions
|
||||
#
|
||||
# sed regular expressions have slightly different behaviors dependending on
|
||||
# the environment, and POSIX [[:space:]] matches whitespace characters other
|
||||
# than just space and tab. These variables provide an easier, portable way to
|
||||
# test for just these two characters.
|
||||
export _TAB_=$'\t'
|
||||
export _SPACE_=$' '
|
||||
export _TAB_SPACE_="${_TAB_}${_SPACE_}"
|
||||
export _TAB_SPACE_CC_="[${_TAB_SPACE_}]"
|
||||
|
||||
# _contains()
|
||||
#
|
||||
# Usage:
|
||||
|
Loading…
Reference in New Issue
Block a user