1,$ s/INITIAL * NEXT/INITIAL 5251072 NEXT/g

1,$ s/INITIAL * NEXT/INITIAL 5251072 NEXT/g

Post by wayn » Tue, 04 Sep 2001 00:45:04



When I issue the following command in the vi I got "substitute pattern match
failed" message:

1,$ s/INITIAL * NEXT/INITIAL 5251072 NEXT/g

Anyone knows where I did wrong?

Thanks,

Wayne

 
 
 

1,$ s/INITIAL * NEXT/INITIAL 5251072 NEXT/g

Post by Akop Pogosia » Tue, 04 Sep 2001 08:20:02



> When I issue the following command in the vi I got "substitute pattern match
> failed" message:
> 1,$ s/INITIAL * NEXT/INITIAL 5251072 NEXT/g

That means that the pattern that you are searching for has not been
found.  By the way, did you mean to say:

s/INITIAL \* NEXT/INITIAL 5251072 NEXT/g ?

Ex understands regular expressions. '*' matches zero or more
occurrences of the character to the left of it. If you need to match
the star "*" you need to escape it.

-akop

 
 
 

1,$ s/INITIAL * NEXT/INITIAL 5251072 NEXT/g

Post by wayn » Tue, 04 Sep 2001 10:35:22


actually I need to replace strings, such as "INITIAL 456 NEXT", "INITIAL
535677 NEXT", ... with "INITIAL 5251072 NEXT".  I thought * will match any
characters but it seems not. I just want to know why.
Thanks for answering my post.

Wayne



> > When I issue the following command in the vi I got "substitute pattern
match
> > failed" message:

> > 1,$ s/INITIAL * NEXT/INITIAL 5251072 NEXT/g

> That means that the pattern that you are searching for has not been
> found.  By the way, did you mean to say:

> s/INITIAL \* NEXT/INITIAL 5251072 NEXT/g ?

> Ex understands regular expressions. '*' matches zero or more
> occurrences of the character to the left of it. If you need to match
> the star "*" you need to escape it.

> -akop

 
 
 

1,$ s/INITIAL * NEXT/INITIAL 5251072 NEXT/g

Post by Akop Pogosia » Tue, 04 Sep 2001 10:43:01



> actually I need to replace strings, such as "INITIAL 456 NEXT", "INITIAL
> 535677 NEXT", ... with "INITIAL 5251072 NEXT".  I thought * will match any
> characters but it seems not. I just want to know why.
> Thanks for answering my post.
> Wayne

To match strings like that you can use the following regular
expresion:

INITIAL [0-9][0-9]* NEXT

[0-9][0-9]* stands for a digit followed by zero or more digits.

-akop

 
 
 

1,$ s/INITIAL * NEXT/INITIAL 5251072 NEXT/g

Post by wayn » Wed, 05 Sep 2001 10:15:44




> > actually I need to replace strings, such as "INITIAL 456 NEXT", "INITIAL
> > 535677 NEXT", ... with "INITIAL 5251072 NEXT".  I thought * will match
any
> > characters but it seems not. I just want to know why.
> > Thanks for answering my post.

> > Wayne

> To match strings like that you can use the following regular
> expresion:

> INITIAL [0-9][0-9]* NEXT

> [0-9][0-9]* stands for a digit followed by zero or more digits.

> -akop

thanks, it worked.

Wayne

 
 
 

1,$ s/INITIAL * NEXT/INITIAL 5251072 NEXT/g

Post by Barry Margoli » Thu, 06 Sep 2001 02:55:50




>I thought * will match any
>characters but it seems not. I just want to know why.

You're confusing shell wildcards with regular expressions.  To match any
number of any characters in a regular expression, use '.*', e.g.

s/INITIAL .* NEXT/INITIAL 5251072 NEXT/g

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. Free UN*X for NeXT (was Re: Linux for NeXT 68040?)



I'm well aware that I may be getting on the nerve of Linux gurus here
(I mean, c.o.l.m68k), but NetBSD-current now has the NeXT port which
includes ipfil that does IP NAT (nearly equivalent to what's called IP
masquerading in the Linux world), if that's good enough for you.  If
you have reasons to prefer Linux over BSD, I'll just shut up, but if
your objective is to run a variant of free UN*X with IP {masquerade,
NAT} on your spare NeXT box, NetBSD-current may be what you're looking
for.

However, not having run it myself, I can't say anything about its
stability, etc., but NetBSD has been extremely stable on my Macintosh
Quadra 840AV (a 68040 box).

See http://www.netbsd.org for more info or join a mailing list (see
the web site for info on the mailing lists).

Ken
---
Any unsolicited message soliciting purchase of any product or service
sent to any of my accounts is subject to a US$50 handling charge per
message.  You have been notified.

2. 'new' is out of virtual memory

3. Files for installing a networked NeXT laser printer under Win95 (Was: Black Next 2.2 + Linux != networking?)

4. need some management tools ...

5. cdrom.com: slack 7/next/sub/sub.next...?

6. System hangs When I startup X everything looks fine. I have my mouse pointer and the right

7. X on one console, mac on the next, windoze on the next...etc

8. URGENT URGENT dlopen() help needed...

9. mounting Linux/NeXT partitions in Linux/NeXT

10. assesing initial server # from server-status ?

11. "Unable to open a initial console" message

12. Unable to open an initial console

13. HELP: stupid computer can't find initial console