11
rated 0 times
[
11]
[
0]
/ answers: 1 / hits: 9821
/ 2 Years ago, mon, february 28, 2022, 8:43:59
I want to replace multiple spaces by a single space. I am using tr
to do this. But it is also replacing new line with a space. How can I avoid it?
Code:
tr -s [:space:] ' '
Input:
He llo
Wor ld
how are you
Required Output:
He llo
Wor ld
how are you
My Output:
He llo Wor ld how are you
More From » bash