Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
egrep Question?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
T  
View profile  
 More options May 11, 10:40 am
Newsgroups: comp.sys.sun.misc
From: T <g41...@motorola.com>
Date: Mon, 11 May 2009 07:40:51 -0700 (PDT)
Local: Mon, May 11 2009 10:40 am
Subject: egrep Question?
Hi:

I was trying to find negative numbers in a file. I found that the
following didn't work:

egrep -e '-[:digit:].[:digit:]' top.sta.rpt

but the following did work:

egrep -e '-[0-9].[0-9]' top.sta.rpt

According to the man page the first one should have worked, unless I'm
missing something which is highly possible.

Thanks
  Tom


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alessandro Selli  
View profile  
 More options May 20, 10:50 am
Newsgroups: comp.sys.sun.misc
From: Alessandro Selli <trapp...@route-add.net>
Date: Wed, 20 May 2009 16:50:29 +0200
Local: Wed, May 20 2009 10:50 am
Subject: Re: egrep Question?

T wrote:
> Hi:

> I was trying to find negative numbers in a file. I found that the
> following didn't work:

> egrep -e '-[:digit:].[:digit:]' top.sta.rpt

  There are square brackets missing:

muser@drone ~ $ cat top.sta.rpt
234
86
-2
57
-651
9743
832
-68732
-7873
muser@drone ~ $ egrep -e '-[[:digit:]].[[:digit:]]' top.sta.rpt
-651
-68732
-7873

  Note you'd still miss the -2 negative number, but this might be the
desired behaviour.

  Bye,

--
Alessandro Selli http://alessandro.route-add.net
AVVERTENZA: i messaggi inviati a "trappola" non mi arriveranno.
WARNING: messages sent to "trappola" will never reach me.
Chiave PGP/GPG key: EC885A8B

  signature.asc
< 1K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Reginald Beardsley  
View profile  
 More options May 20, 6:02 pm
Newsgroups: comp.sys.sun.misc
From: Reginald Beardsley <u...@example.net>
Date: Wed, 20 May 2009 17:02:13 -0500
Local: Wed, May 20 2009 6:02 pm
Subject: Re: egrep Question?

Curious.  What egrep are you using? On Solaris 10 U6 x86, /bin/egrep
produced no output w/ your example, but "egrep -e '-[0-9]' " produced
the desired output.

Reg


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alessandro Selli  
View profile  
 More options Jun 30, 2:10 pm
Newsgroups: comp.sys.sun.misc
From: Alessandro Selli <trapp...@route-add.net>
Date: Tue, 30 Jun 2009 20:10:40 +0200
Local: Tues, Jun 30 2009 2:10 pm
Subject: Re: egrep Question?

Reginald Beardsley ha scritto:

  Sorry, I forgot about this matter.

-bash-3.00$ uname -a
SunOS lustro 5.10 Generic_141414-01 sun4u sparc SUNW,Sun-Blade-1000
-bash-3.00$ cat /etc/release
                       Solaris 10 5/09 s10s_u7wos_08 SPARC
           Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                             Assembled 30 March 2009
-bash-3.00$ which egrep
/usr/xpg4/bin/egrep

/usr/bin/egrep doesn't do the job:

-bash-3.00$ /usr/bin/egrep -e '-[[:digit:]].[[:digit:]]' top.sta.rpt
-bash-3.00$/usr/bin/egrep -e '-[:digit:].[:digit:]' top.sta.rpt
-bash-3.00$

  Bye,

--
Alessandro Selli http://alessandro.route-add.net
AVVERTENZA: i messaggi inviati a "trappola" non mi arriveranno.
WARNING: messages sent to "trappola" will never reach me.
Chiave PGP/GPG key: EC885A8B

  signature.asc
< 1K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google