Commit 02830158 authored by Vitaly Lipatov's avatar Vitaly Lipatov

tools_estrlist: add has_space function

parent c074cdf2
......@@ -43,11 +43,23 @@ strip_spaces()
echo "$*" | filter_strip_spaces
}
isempty()
is_empty()
{
[ "$(strip_spaces "$*")" = "" ]
}
isempty()
{
is_empty "$@"
}
has_space()
{
# not for dash:
# [ "$1" != "${1/ //}" ]
[ "$(echo "$*" | sed -e "s| ||")" != "$*" ]
}
list()
{
local i
......@@ -230,7 +242,8 @@ help()
# echo " reg_wordexclude <list PATTERN> [word list] - print only words do not match PATTERN"
echo " has <PATTERN> string - check the string for a match to the regular expression given in PATTERN (grep notation)"
echo " match <PATTERN> string - check the string for a match to the regular expression given in PATTERN (egrep notation)"
echo " isempty [string] - true if string has no any symbols (only zero or more spaces)"
echo " isempty [string] (is_empty) - true if string has no any symbols (only zero or more spaces)"
echo " has_space [string] - true if string has no spaces"
echo " union [word list] - sort and remove duplicates"
echo " intersection <list1> <list2> - print only intersected items (the same in both lists)"
echo " difference <list1> <list2> - symmetric difference between lists items (not in both lists)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment