scripting/regex help

Eric "Shubes" plug at shubes.net
Mon Jun 12 11:30:49 MST 2006


Jeremy C. Reed wrote:
> On Mon, 12 Jun 2006, Eric "Shubes" wrote:
> 
>> I have a variable x=qmail-toaster-1.2.9-1.3.1.src.rpm
>>
>> I want a variable y=qmail-toaster
>>
>> I'm thinking that to get from x to y, I need to strip -*-*.src.rpm off the
>> end. How do I do that? (or is there a better way?)
> 
> sed -e 's,-[^-]*-[^-]*.src.rpm$,,'
> 
>  Jeremy C. Reed
> 
Excellent! I promise I'll study it until I understand how it works.
Thanks a bunch!

-- 
-Eric 'shubes'


More information about the PLUG-discuss mailing list