Re: sed problem

From: Adams Kevin J (kevin.adams@PHS.COM)
Date: Fri Jul 19 2002 - 16:52:59 EDT


Doesn't * mean zero or more and + means one or more?

Kevin

-----Original Message-----
From: Y.SINGH@PONL.COM [mailto:Y.SINGH@PONL.COM]
Sent: Friday, July 19, 2002 1:16 PM
To: aix-l@Princeton.EDU
Subject: [aix-l] sed problem

Friends , a stupid question.
Following is the file of 9 lines (sample.txt) :
900
12356
2.1
3.14159265
87878787
0.25

a

if i give command ,
sed -n -e '/900*/p' sample.txt
I get output of just one line ,
900

Now if I give command ,
sed -n -e '/[09]*/p' sample.txt
I get all the lines in output ,
900
12356
2.1
3.14159265
87878787
0.25

a

Why is that ?? I am expecting combination of only 0 & 9 in output .
Please advice.

-------------------------------------------------------------------

The contents of this e-mail are confidential to the ordinary user
of the e-mail address to which it was addressed and may also be
privileged. If you are not the addressee of this e-mail you should
not copy, forward, disclose or otherwise use it or any part of it
in any form whatsoever. If you have received this e-mail in error
please notify us by telephone or e-mail the sender by replying to
this message, and then delete this e-mail and other copies of it
from your computer system. Thank you.

We reserve the right to monitor all e-mail communications through
our network.

This electronic message transmission, including any attachments, contains information from PacifiCare Health Systems Inc. which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited.

If you have received this electronic transmission in error, please notify the sender immediately by a "reply to sender only" message and destroy all electronic and hard copies of the communication, including attachments.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:04 EDT