Thread View: net.bugs
3 messages
3 total messages
Started by pjbk
Thu, 17 Apr 1986 13:47
awk bug (or is it a feature)
Author: pjbk
Date: Thu, 17 Apr 1986 13:47
Date: Thu, 17 Apr 1986 13:47
16 lines
1099 bytes
1099 bytes
Our version of awk does not allow one to use a field specified
by a numerical expression as the left hand side of an expression.
The file below will pass the standard input through unmodified,
although it is designed to replace the last field in each record
with "LAST FIELD". Is this a bug or a feature?
-----------------------
{ $NF = "LAST FIELD"
print}
-----------------------
--
Peter King, Heriot-Watt University
JANET: pjbk@uk.ac.hw.cs
ARPA: pjbk@cs.hw.ac.uk
or - pjbk%cs.hw.ac.uk@ucl-cs
UUCP: ..!ukc!cs.hw.ac.uk!pjbk
Re: awk bug (or is it a feature)
Author: gwyn
Date: Mon, 21 Apr 1986 01:40
Date: Mon, 21 Apr 1986 01:40
10 lines
1014 bytes
1014 bytes
In article <800@brahma.cs.hw.AC.UK> pjbk@cs.hw.ac.uk (Peter King) writes:
>The file below will pass the standard input through unmodified,
>although it is designed to replace the last field in each record
>with "LAST FIELD". Is this a bug or a feature?
> { $NF = "LAST FIELD"
> print}
Must be a bug; it works here (SVR2 + bug fixes).
Make sure the shell does not mess with the special characters
(enclose the whole expression in 'quotes').
Re: awk bug (or is it a feature)
Author: P. D. Guthrie
Date: Tue, 22 Apr 1986 20:18
Date: Tue, 22 Apr 1986 20:18
17 lines
1220 bytes
1220 bytes
In article <800@brahma.cs.hw.AC.UK> pjbk@cs.hw.ac.uk (Peter King) writes:
>Our version of awk does not allow one to use a field specified
>by a numerical expression as the left hand side of an expression.
>
>The file below will pass the standard input through unmodified,
>although it is designed to replace the last field in each record
>with "LAST FIELD". Is this a bug or a feature?
> -----------------------
> { $NF = "LAST FIELD"
> print}
This works fine for me, so you must have a bug in your release.
--
Paul Guthrie `When the going gets weird,
ihnp4!ihdev!pdg The weird turn pro'
- H. Thompson
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