bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Input line splitting and OFS


From: david kerns
Subject: Re: Input line splitting and OFS
Date: Fri, 15 Nov 2019 07:08:45 -0700

OFS is used whenever you construct output... modifying $0 (or anything $N
that results in $0 being modified) is considered "output" ... many awk
programmers set OFS=FS whenever they intend to modify $0... or as Peter
Brooks suggested, copy $0 to a local var, and modify the local var.
Specifically, to avoid modifying $0.

On Fri, Nov 15, 2019 at 7:03 AM Andrew J. Schorr <
address@hidden> wrote:

> Hi,
>
> On Fri, Nov 15, 2019 at 11:25:26AM +0000,
> address@hidden wrote:
> > But my question is more about the reasoning behind the use of OFS in the
> context of an input line. Why is OFS used, when we’re dealing with input ?
>
> What else could be used to reassemble the input line? Keep in mind that FS
> could contain a regular expression, etc., or we could be using FPAT. The
> OFS
> constant value is the only thing available for reassembling $0, isn't it?
>
> Regards,
> Andy
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]