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
572f0947
Commit
572f0947
authored
Dec 20, 2024
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
estrlist: add new verbs: firstupper, tolower
parent
9623b141
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
tools_estrlist
bin/tools_estrlist
+18
-0
No files found.
bin/tools_estrlist
View file @
572f0947
...
...
@@ -63,6 +63,20 @@ last()
echo
"
$*
"
| xargs
-n1
echo
2>/dev/null |
tail
-n1
}
firstupper
()
{
# FIXME: works with GNU sed only
list
"
$*
"
|
sed
's/.*/\u&/'
}
tolower
()
{
# tr is broken in busybox (checked with OpenWrt)
#echo "$*" | tr "[:upper:]" "[:lower:]"
list
"
$*
"
|
awk
'{print tolower($0)}'
}
has_space
()
{
# not for dash:
...
...
@@ -292,6 +306,8 @@ help()
echo
" contains <word> [word list] - check if word list contains the word"
echo
" first <word list> - print first word"
echo
" last <word list> - print last word"
echo
" firstupper <word list> - print the words with first letter of each in upper case"
echo
" tolower <word list> - print the words in lower case"
echo
echo
"Examples:"
# example reg_remove "1." "11 12 21 22"
...
...
@@ -311,6 +327,8 @@ help()
example_res match
"M[0-9]+"
"MI"
example_res first
"1 2 3"
example_res last
"1 2 3"
example_res firstupper
"world camp"
example_res tolower
"World Camp"
}
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