Re: Help with String Extraction - Variation
- From: Icarus Sparry <usenet@xxxxxxxxxxxxxxxxx>
- Date: 26 Sep 2007 11:55:22 GMT
On Wed, 26 Sep 2007 10:53:12 +0000, Vishal Sharma wrote:
[snip]
Why i need to only extract from the "load average" string, is because
everytime the output of command uptime might vary. sometimes the time is
shown like this
server0 up 6 days 42 mins load average: 0.01 0.02 0.03
so in such a case your suggestion might not work. So the easiest would
be to search for the word "load" and extract everything after that.
Pls provide me some solution.
Thanks,
So you have a clear requirement, just write it....
sed 's/^.*load/load/'
or in english, the sed "program s/^.*load/load, protected by "'"
characters so the shell leaves it alone
s substitue
/ use / as the pattern delimiter
^ start of line
.. any character
* repeated any number of times, including zero
load followed by "l", "o", "a", and "d" in that order
/ end of first pattern, start of second pattern
load the characters "l", "o", "a", and "d"
/ end of second pattern
.
- References:
- Help with String Extraction - Variation
- From: Vishal Sharma
- Re: Help with String Extraction - Variation
- From: Chris F.A. Johnson
- Re: Help with String Extraction - Variation
- From: Vishal Sharma
- Help with String Extraction - Variation
- Prev by Date: comparision script (if STATEMENT)
- Next by Date: Re: copy config files from one box to another
- Previous by thread: Re: Help with String Extraction - Variation
- Next by thread: comparision script (if STATEMENT)
- Index(es):
Relevant Pages
|