Re: latest -current broke netscape's name lookup?

2001-11-04 Thread Bill Fenner


awk does not copy input lines to its output unless asked; you can
ask with either an explicit print or an empty action.

Using an input file like:

gibberish
stuff
this doesn't match
here is some garbola
I don't want this file in the ouptut
here's some more stuff
and another line
and another
and another
ooh baby
hosts: files dns
don't print this either

the awk program in /etc/rc.network, without the //{next}, and
changing quit to exit, prints:

# Auto-generated, do not edit
hosts
bind

using either the old gawk or the new awk.

That //{next} may have been necessary during some phase of
script development, but is not necessary now.

  Bill

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: latest -current broke netscape's name lookup?

2001-11-02 Thread Dag-Erling Smorgrav

David Wolfskill [EMAIL PROTECTED] writes:
   Of
 course, one of the other interesting issues with the above patch is that
 awk was whining about the empty regex (//).  Since the idea was
 apparently to do nothing for such a record, it seemed simpler to just
 not tell awk to do anything with it, and that seemed to work in my
 tests.]

Bzzzt!  Wrong.  That clause needs to be there to prevent awk from
copying non-matching lines from nsswitch.conf to host.conf.  If 1Tawk
complains about empty regexps, just remove the regexp, but leave the
clause there.

DES
-- 
Dag-Erling Smorgrav - [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: latest -current broke netscape's name lookup?

2001-11-02 Thread David Wolfskill

From: Dag-Erling Smorgrav [EMAIL PROTECTED]
Date: 03 Nov 2001 03:34:01 +0100

 course, one of the other interesting issues with the above patch is that
 awk was whining about the empty regex (//).  Since the idea was
 apparently to do nothing for such a record, it seemed simpler to just
 not tell awk to do anything with it, and that seemed to work in my
 tests.]

Bzzzt!  Wrong.  That clause needs to be there to prevent awk from
copying non-matching lines from nsswitch.conf to host.conf.  If 1Tawk
complains about empty regexps, just remove the regexp, but leave the
clause there.

Actually, I tried that.  Maybe I should have put it in braces, but I
thought I tried that, too.  Hmmm... I can hack on the build machine a
bit...  I was aware that sed, by default, would print its input to
output, but had thought that awk would not

OK; my error -- this does work:

Index: etc/rc.network
===
RCS file: /cvs/freebsd/src/etc/rc.network,v
retrieving revision 1.110
diff -u -r1.110 rc.network
--- etc/rc.network  1 Nov 2001 12:39:01 -   1.110
+++ etc/rc.network  3 Nov 2001 02:47:06 -
@@ -888,7 +888,7 @@
 print xlat[$n];
 quit;
 }
-// {
+{
 next;
 }
 ' $nsswitch_conf $host_conf

Sorry about that,
david
-- 
David H. Wolfskill  [EMAIL PROTECTED]
As a computing professional, I believe it would be unethical for me to
advise, recommend, or support the use (save possibly for personal
amusement) of any product that is or depends on any Microsoft product.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: latest -current broke netscape's name lookup?

2001-11-02 Thread Dag-Erling Smorgrav

David Wolfskill [EMAIL PROTECTED] writes:
 Actually, I tried that.  Maybe I should have put it in braces, but I
 thought I tried that, too.  Hmmm... I can hack on the build machine a
 bit...  I was aware that sed, by default, would print its input to
 output, but had thought that awk would not

I don't remember if it does, or if it only prints a blank line, but I
put that clause in for a reason.

DES
-- 
Dag-Erling Smorgrav - [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message