🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Dale Worley Mon, 26 Oct 1987 16:26
New (UnixTC) awk - warning
#626
Author: Dale Worley
Date: Mon, 26 Oct 1987 16:26
23 lines
1113 bytes
root@investor.UUCP (Bob Peirce) writes:
> 'BEGIN {
> 	stuff
> }{
> 	more stuff
> }'
> 
> The manual
> states on p.22 that "The opening brace of an action must be on the
> same line as the pattern it accompanies."

Eh?  As far as I can tell, the pattern is an implied "all lines",
physically represented by the null string immediately preceeding the
open brace.  And that null string is on the same line as the open
brace.

What am I missing?

Dale
-- 
Dale Worley    Cullinet Software      ARPA: culdev1!drw@eddie.mit.edu
UUCP: ...!seismo!harvard!mit-eddie!culdev1!drw
If you get fed twice a day, how bad can life be?
Re: New (UnixTC) awk - warning
#636
Author: Brandon Allbery
Date: Sat, 31 Oct 1987 03:32
31 lines
1756 bytes
As quoted from <1697@culdev1.UUCP> by drw@culdev1.UUCP (Dale Worley):
+---------------
| root@investor.UUCP (Bob Peirce) writes:
| > 'BEGIN {
| > 	stuff
| > }{
| > 	more stuff
| > }'
| > 
| > states on p.22 that "The opening brace of an action must be on the
| > same line as the pattern it accompanies."
| 
| Eh?  As far as I can tell, the pattern is an implied "all lines",
| physically represented by the null string immediately preceeding the
| open brace.  And that null string is on the same line as the open
| brace.
| What am I missing?
+---------------

That the format of an awk "rule" is

pattern action \n

In particular, the pattern MUST be the first thing on the line.  I have been
writing awk scripts with this in mind the whole time that I have used awk;
as a result, my scripts are compatible.  Using undocumented behavior is a
good way to be burned by changes to a program.
-- 
Brandon S. Allbery		     necntc!ncoast!allbery@harvard.harvard.edu
 {harvard!necntc,well!hoptoad,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery
"Uncle _who_?" -- Lt. Worf		       ^^^^^^^^^^^^^ NOTE NEW PATH!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads