The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
remove blank spaces in a string
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
remove blank spaces in a string
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
03-01-2006
zazzybob
Registered Geek
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Well, according to that, you want to replace the space with a comma?
echo "$STR" | tr ' ' ','
echo "$STR" |
sed
's/ /,/g' # g isn't strictly needed here
Cheers
ZB
zazzybob
View Public Profile
Visit zazzybob's homepage!
Find all posts by zazzybob