[ale] Question on Regex or sed

Horkan Smith ale at horkan.net
Mon Jul 8 18:21:41 EDT 2013


Try

# removes a comma at end of line
sed 's/,$//'

or

# removes a comma and any spaces at end of line
sed 's/, *$//'


later!
   horkan

On Mon, Jul 08, 2013 at 06:00:16PM -0400, Chuck Payne wrote:
> I did an update, but when I run, I notice that it placed an extra , on the end.
> 
> I been searching have a very bad headache from it, looking for how to
> remove that extra ,
> 
> The problem is from the following string
> 
> city, state
> 
> I tried this before doing my search
> 
> sed 's'/\,//g'
> 
> That removed the first common
> 
> city st,
> 
> I remember that you need to use ^ $, so what is it that I need to
> remove that common on the end.
> 
> Sorry, I am not good at regex, so I need a bit of help.
> 
> --
> Terror PUP a.k.a
> Chuck "PUP" Payne
> 
> (678) 636-9678
> -----------------------------------------
> Discover it! Enjoy it! Share it! openSUSE Linux.
> -----------------------------------------
> openSUSE -- en.opensuse.org/User:Terrorpup
> openSUSE Ambassador/openSUSE Member
> Community Manager -- Southeast Linux Foundation (SELF)
> skype,twiiter,identica,friendfeed -- terrorpup
> freenode(irc) --terrorpup/lupinstein
> Register Linux Userid: 155363
> 
> Have you tried SUSE Studio? Need to create a Live CD,  an app you want
> to package and distribute , or create your own linux distro. Give SUSE
> Studio a try. www.susestudio.com.
> See you at Southeast Linux Fest, June 7-9, 2013 in Charlotte, NC.
> www.southeastlinuxfest.org
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo

-- 
Horkan Smith
678-777-3263 cell, ale at horkan.net


More information about the Ale mailing list