nawk & match() function

nawk & match() function

Post by Pete » Fri, 01 Dec 2000 04:00:00



Hi,

I think match() function doesn't work on AIX  4.3.4.0.
I tried something like that:
echo AAAAAAAA | nawk '{match($0,/[A-Z0-9_]+/); print $0, RSTART, RLENGTH}'

and nawk returns:
AAAAAAAA 0 -1

on AIX 4.3.2.0 nawk returns:
AAAAAAAA 1 8

I can't find any patch for this bug.
Thanks for any advice

Pete

 
 
 

nawk & match() function

Post by Pete » Sat, 02 Dec 2000 16:25:10


Quote:> Hi,

> I think match() function doesn't work on AIX  4.3.4.0.

Sorry, I checked again oslevel. This is AIX 4.3.3.0

Quote:> I tried something like that:
> echo AAAAAAAA | nawk '{match($0,/[A-Z0-9_]+/); print $0, RSTART, RLENGTH}'

> and nawk returns:
> AAAAAAAA 0 -1

> on AIX 4.3.2.0 nawk returns:
> AAAAAAAA 1 8

> I can't find any patch for this bug.
> Thanks for any advice

> Pete

Pete

 
 
 

nawk & match() function

Post by bo » Sat, 02 Dec 2000 04:00:00


[This followup was posted to comp.unix.aix and a copy was sent to the
cited author.]


Vendor implementations of awk/nawk do wierd things depending
on what O/S you are on, suggest using gawk, that way at least
you know the oddity will be the same on the next machine

brett

Quote:> I think match() function doesn't work on AIX  4.3.4.0.
> I tried something like that:
> echo AAAAAAAA | nawk '{match($0,/[A-Z0-9_]+/); print $0, RSTART, RLENGTH}'

> and nawk returns:
> AAAAAAAA 0 -1

> on AIX 4.3.2.0 nawk returns:
> AAAAAAAA 1 8

> I can't find any patch for this bug.
> Thanks for any advice

> Pete

 
 
 

1. static functions in library matching global functions

I have a peculiar problem which I'm sure you gurus can answer.

I've created a full-blown Motif widget for Solaris 2.5.1 and I've compiled
it into a dynamic shared library so that I can use it in multiple programs.

The problem is, however, that some of the static functions in the library
have the same names as public functions in the application that uses the
library, and at runtime the library calls the global functions instead of
its own static functions!

I thought that static stuff were renamed so that it would not be accessible
nor possibly match other functions. If, for instance, a static variables in
two object modules have the same name, how do the compiler know which one to
use, and when? But if functions are renamed, how come the application
manages to call the wrong functions?

Is the behavior perhaps different when compiling a library (I'm using cc
4.2)? Is there a switch I can use to make the library call the correct
static functions?

Please help, as I don't know how to solve this problem (other than the
obvious; renaming the functions, of course (which is not a good solution
since I can never be 100% sure whether some other program has global
functions with the same names...).

--
Ketil Hunn

2. NEC CDR-273 CD-ROM problems w/ Slackware v1.2.3

3. Nawk matching "):" -- Can it be done?

4. Would Linux run well on my system?

5. nawk functions

6. Anyone Using Powerlink?

7. two simple nawk questions, Sunos 4.1.2 and nawk

8. symbol for io...

9. nawk (gawk) user defined functions question

10. nawk builtin `system' function

11. Calling a sh function from a nawk script.

12. pattern match&search&edit for a text file

13. Traffic Shaping & signature match & conntrack