The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Leading and Trailing Spaces
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Leading and Trailing Spaces
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
10-29-2003
Ygor
Moderator
Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
Seems like you only want to remove only the spaces either side of a comma. Try...
Code:
echo "Amy Reds , 100 , /bin/sh" |
sed
's/[ ]*,[ ]*/,/g'
Ygor
View Public Profile
Find all posts by Ygor
Find Ygor's past nominations received
Find Ygor's present nominations given