scripting help

peter kostov fedora at light-bg.com
Fri Sep 29 20:11:14 UTC 2006


On Fri, 2006-09-29 at 14:08 -0400, Steven W. Orr wrote:
> On Friday, Sep 29th 2006 at 16:59 +0100, quoth Tom Brown:
> 
> =>Hi
> =>
> =>I have a script and the output of that script is currently
> =>
> =>UCD-SNMP-MIB::ucdavis.55.101.1 = STRING: "CRITICAL emcpowera, 2 dead, 2 alive,
> =>possible LUN tresspass or HBA failure"
> =>
> =>is there anyway to cut off the text '
> =>UCD-SNMP-MIB::ucdavis.55.101.1 = STRING: '
> =>
> =>so that i get whatever comes AFTER that ?
> =>
> =>thanks
> 
> You're probably going to get some youngh whippersnapper who has a solution 
> which will involve conspicuous resource consumption, like the use of sed.
> 
> 
> foo==>'UCD-SNMP-MIB::ucdavis.55.101.1 = STRING: "CRITICAL emcpowera, 2 dead, 2 alive, possible LUN tresspass or HBA failure"'
> echo ${foo#*STRING}
> 
> :-)
> 
Hi Steven! You are right about sed - it is a wonderful program, but
really CPU intensive. But that you posted doesn't work when copied
exactly, however this
 foo='UCD-SNMP-MIB::ucdavis.55.101.1 = STRING: "CRITICAL emcpowera, 2 dead, 2 alive, possible LUN tresspass or HBA failure"'
 echo ${foo#*STRING:}
works as Tom wants. I don't quite understand this, but it is interesting
approach. Could you explain it a little bit more, or point me to a link
where I can read more!

Best regards,

Peter
> -- 
> Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
> happened but none stranger than this. Does your driver's license say Organ ..0
> Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
> individuals! What if this weren't a hypothetical question?
> steveo at syslang.net
> 
-- 
Peter Kostov
Sofia, Bulgaria

Photographer, web designer,
3D modeling, informational services

Home site: http://www.light-bg.com




More information about the fedora-list mailing list