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
18ccb988
Commit
18ccb988
authored
Feb 22, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
estrlist: add has command (instead grep -q)
parent
d1377c05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
estrlist
bin/estrlist
+16
-0
No files found.
bin/estrlist
View file @
18ccb988
...
...
@@ -60,6 +60,13 @@ uniq()
union
$@
}
has
()
{
local
wd
=
"
$1
"
shift
echo
"
$@
"
|
grep
-q
"
$wd
"
}
# remove_from_list "1." "11 12 21 22" -> "21 22"
reg_remove
()
{
...
...
@@ -138,6 +145,11 @@ example()
$0
$CMD
"
$ARG1
"
"
$@
"
}
example_res
()
{
example
"
$@
"
&&
echo
TRUE
||
echo
FALSE
}
help
()
{
echo
"estrlist developed for string list operations. See also cut, join, paste..."
...
...
@@ -163,6 +175,8 @@ help()
example reg_wordexclude
"wo.* er"
"work were more else"
example union
"1 2 2 3 3"
example count
"1 2 3 4 10"
example_res has ex
"exactly"
example_res has exo
"exactly"
}
COMMAND
=
"
$1
"
...
...
@@ -181,6 +195,8 @@ shift
if
[
"
$1
"
=
"-"
]
;
then
shift
"
$COMMAND
"
"
$(
cat
)
$@
"
elif
[
"
$2
"
=
"-"
]
;
then
"
$COMMAND
"
"
$1
"
"
$(
cat
)
"
else
"
$COMMAND
"
"
$@
"
fi
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