How to trim whitespace of a string in Bash

1 Answer

0 votes
s="    bash is a unix shell and command language       "
 
echo $s | xargs

 
 
 
# run:
#
# bash is a unix shell and command language
#

 



answered Jun 6, 2021 by avibootz

Related questions

1 answer 227 views
1 answer 209 views
3 answers 290 views
2 answers 568 views
2 answers 347 views
1 answer 244 views
1 answer 202 views
...