Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
53a6e4ad
Commit
53a6e4ad
authored
Apr 02, 2024
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
estrlist: add contains
parent
b0761cf6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
tools_estrlist
bin/tools_estrlist
+10
-0
No files found.
bin/tools_estrlist
View file @
53a6e4ad
...
...
@@ -235,6 +235,13 @@ reg_include()
strip_spaces
"
$RES
"
}
contains
()
{
#estrlist has "$1" "$2"
local
res
=
"
$(
estrlist reg_wordexclude
"
$1
"
"
$2
"
)
"
[
"
$res
"
!=
"
$2
"
]
}
example
()
{
local
CMD
=
"
$1
"
...
...
@@ -272,6 +279,7 @@ help()
echo
" uniq [word list] - alias for union"
echo
" list [word list] - just list words line by line"
echo
" count [word list] - print word count"
echo
" contains <word> [word list] - check if word list contains the word"
echo
echo
"Examples:"
# example reg_remove "1." "11 12 21 22"
...
...
@@ -280,6 +288,8 @@ help()
example reg_exclude
"22 1."
"11 12 21 22"
example reg_wordexclude
"wo.* er"
"work were more else"
example union
"1 2 2 3 3"
example_res contains
"wo"
"wo wor"
example_res contains
"word"
"wo wor"
example count
"1 2 3 4 10"
example_res isempty
" "
#example_res isempty " 1 "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment