Re: To grep, or not to grep, that is the question :-)

2003-06-27 Thread Adam Bowns
Thanks for all your responses, you've all been a great help. Thanks again, Adam Bowns -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list

Re: To grep, or not to grep, that is the question :-)

2003-06-27 Thread Jonathan Bartlett
sensors|grep CPU:|perl -e '$a = <>; if($a =~ m/\+([\d\.]+)/){ print $1; }' > cpu Jon > which gives me a file called cpu with contents: - > CPU: +53.4?C (limit = +120?C, hysteresis = +100?C) > > the problem im having is that i need the file to just contain: - > 53.4 > > or whatever the valu

Re: To grep, or not to grep, that is the question :-)

2003-06-27 Thread Ed Wilts
On Fri, Jun 27, 2003 at 09:49:42PM +0100, Adam Bowns wrote: > sensors |grep CPU: |cat > cpu For starters, you don't need the last pipe. This will do: sensors | grep CPU: > cpu > which gives me a file called cpu with contents: - > CPU: +53.4?C (limit = +120?C, hysteresis = +100?C) > > the

Re: To grep, or not to grep, that is the question :-)

2003-06-27 Thread Matt Ryanczak
Use awk along wit grep like this: sensors | grep -i cpu | awk '{print $2}' this should produce "+53.4?C" given the output you provided. On Fri, 2003-06-27 at 16:49, Adam Bowns wrote: > Hello all, > > What I am trying to do is run a command and take a very specific part of > a line of its outpu

To grep, or not to grep, that is the question :-)

2003-06-27 Thread Adam Bowns
Hello all, What I am trying to do is run a command and take a very specific part of a line of its output and save it to a file. Here's the route i've been going down so far... with no success might I add. the program im running is called sensors (lm_sensors) and run on its own gives output of the

RE: grep 'or'

2002-09-19 Thread Furnish, Trever G
2 9:39 AM > To: [EMAIL PROTECTED] > Subject: Re: grep 'or' > > > from "info regex": >Alternatives match one of a choice of regular expressions: > if you put > the character(s) representing the alternation operator between any two > regular expre

Re: grep 'or'

2002-09-19 Thread Anthony E. Greene
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 19-Sep-2002/09:38 -0500, "Blake C. Lewis" <[EMAIL PROTECTED]> wrote: >from "info regex": [snip] I found the same info in regex(7) but the key is to use it with egrep, not grep. Tony - -- Anthony E. Greene OpenPGP Key:

Re: grep 'or'

2002-09-19 Thread Blake C. Lewis
from "info regex": Alternatives match one of a choice of regular expressions: if you put the character(s) representing the alternation operator between any two regular expressions A and B, the result matches the union of the strings that A and B match. For example, supposing that `|' is the al

Re: grep 'or'

2002-09-18 Thread Anthony E. Greene
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18-Sep-2002/17:34 -0700, smoke <[EMAIL PROTECTED]> wrote: >is there a way to "or" grep? > >like grep a or b Please do not use "Reply" to start a new thread. Even if you change the subject, the new message is still threaded with the original. Thi

grep 'or'

2002-09-18 Thread smoke
is there a way to "or" grep? like grep a or b thanks! __ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat