Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
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
korinf
etersoft-build-utils
Commits
401c3c1f
Commit
401c3c1f
authored
Jun 17, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
estrlist: improve has, add match with egrep
parent
1671f9b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
estrlist
bin/estrlist
+14
-1
No files found.
bin/estrlist
View file @
401c3c1f
...
...
@@ -64,9 +64,18 @@ has()
{
local
wd
=
"
$1
"
shift
echo
"
$
@
"
|
grep
-q
"
$wd
"
echo
"
$
*
"
|
grep
-q
--
"
$wd
"
}
# Note: used egrep! write '[0-9]+(first|two)', not '[0-9]\+...'
match
()
{
local
wd
=
"
$1
"
shift
echo
"
$*
"
| egrep
-q
--
"
$wd
"
}
# remove_from_list "1." "11 12 21 22" -> "21 22"
reg_remove
()
{
...
...
@@ -162,6 +171,8 @@ help()
echo
"exclude <list1> [list2] - print list2 words contains also in list1"
echo
"reg_exclude <PATTERN> [word list] - print only words not matched with PATTERN"
echo
"reg_wordexclude <PATTERN> [word list] - print only words not matched with 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
"union [word list] - sort and remove duplicates"
echo
"uniq [word list] - alias for union"
echo
"list [word list] - just list words line by line"
...
...
@@ -177,6 +188,8 @@ help()
example count
"1 2 3 4 10"
example_res has ex
"exactly"
example_res has exo
"exactly"
example_res match
"M[0-9]+"
"M250"
example_res match
"M[0-9]+"
"MI"
}
COMMAND
=
"
$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