Hello again,
* Paul Eggert wrote on Tue, Nov 21, 2006 at 04:31:59PM CET:
> Ralf Wildenhues <[EMAIL PROTECTED]> writes:
>
> > It helps to keep m4 from expanding $0, without needing to think about
> > level of m4 quotation currently in place. AFAIK it's portable.
>
> Yes, I just checked the Unix Version 7 sources, and it seems to have
> worked there.
Well, seems '$ 0' isn't quite the same as '$0', at least with Solaris
/bin/awk:
$ cat dummy.in
@ac_Dummy_001@
@f1@
$ awk '{ $0 = $0 "x" $0 ; print $0 }' < dummy.in
awk: can't set $0
record number 1
$ awk '{ $ 0 = $0 "x" $0 ; print $ 0 }' < dummy.in
@[EMAIL PROTECTED]@ac_Dummy_001@
@[EMAIL PROTECTED]@f1@
$ awk '{ $ 0 = $ 0 "x" $ 0 ; print $ 0 }' < dummy.in
@[EMAIL PROTECTED]@ac_Dummy_001@
@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@ac_Dummy_001@
The following one is the most interesting: with one Solaris 5.8 host,
I get an infinite loop and no output, on another 5.8 host I get:
$ awk '{ $ 0 = $ 0 "x" $ 0 ; print }' < dummy.in
@ac_Dummy_001@
@f1@
(The host in question is not available ATM.)
This is all easy to work around, another proposed patch to appear.
Cheers,
Ralf