Move f_isinteger() to the top

Grouping builtins-only algos together
This commit is contained in:
dteske 2016-01-31 21:33:24 +00:00
parent 7873161767
commit 5a5c0e7cfe

View File

@ -52,6 +52,16 @@ VALID_VARNAME_CHARS="0-9ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_"
############################################################ FUNCTIONS
# f_isinteger $arg
#
# Returns true if argument is a positive/negative whole integer.
#
f_isinteger()
{
local arg="${1#-}"
[ "${arg:-x}" = "${arg%[!0-9]*}" ]
}
# f_substr [-v $var_to_set] $string $start [$length]
#
# Similar to awk(1)'s substr(), return length substring of string that begins
@ -267,16 +277,6 @@ f_number_of_lines()
awk "$f_number_of_lines_awk"
}
# f_isinteger $arg
#
# Returns true if argument is a positive/negative whole integer.
#
f_isinteger()
{
local arg="${1#-}"
[ "${arg:-x}" = "${arg%[!0-9]*}" ]
}
# f_uriencode [$text]
#
# Encode $text for the purpose of embedding safely into a URL. Non-alphanumeric