Function : trim ltrim rtrim trimv trimall Desc : Delete leading/trailing blank characters from a string or : stream. : : Blank charaters are space, tab, and new-line. : : trim strip string/file of leading+trailing blank chars. : ltrim strip string/file of leading blank chars. : rtrim strip string/file of trailing blank chars. : trimv assign stripped string to variable. : trimall strip string/file of trailing blank chars and double spaces within string. : Synopsis : trim [-e] string|- : ltrim string|- : rtrim string|- : trimv -n varname string|- : trimall string|- : Examples : #0) strip spaces from around 'str' : str=" 123 "; str=$(trim "$str") : : #1) remove all leading+trailing blanks. : trim <fat.file >thin.file : : #2) remove trailing blanks from file. : rtrim <fat.file >lean.file : : #3) remove all leading+trailing blanks from file, scenic route. : rtrim <fat.file | ltrim >thin.file : : #4) Assign stripped string to varname. : trimv -n myvar " This is a messy string. " : echo "$myvar" :
-
Notifications
You must be signed in to change notification settings - Fork 0
License
Open-Technology-Foundation/trim
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description or website provided.
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published