Re: scripting help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, Sep 29th 2006 at 23:11 +0300, quoth peter kostov:

=>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

man bash

Read the section on Parameter Expansion

Sorry about the extra=>
It was the result of a bad hack'n'wack

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux