|
Trim multiple spaces in a string in BASH
|
|
11-21-2009, 06:24 AM
(This post was last modified: 11-22-2009 02:21 AM by Back_track.)
Post: #1
|
|||
|
|||
|
Trim multiple spaces in a string in BASH
echo "Hello world
" | tr -s " "result = Hello world
|
|||
|
05-16-2010, 09:09 PM
Post: #2
|
|||
|
|||
|
RE: Trim multiple spaces in a string in BASH
I was looking through bash commands that codecaine posted and i came on to this one.
I though that it would be good to make it. I know that Delphi has similar function that only trims spaces " ". It has trim(), trimleft() and trimright() functions. Here is the example : Code: varCode: [Text ]"I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein |
|||
|
« Next Oldest | Next Newest »
|




" | tr -s " "

