In GNU Awk I was looking for the in-place option (similar to sed -i).
I thought there once was some _simple_ option usable from the command
line. (Or am I misremembering?)
In article <100p11m$3uh3m$1@dont-email.me>,
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
In GNU Awk I was looking for the in-place option (similar to sed -i).
I thought there once was some _simple_ option usable from the command
line. (Or am I misremembering?)
The manual now suggests to use a GNU Awk "inplace" _Extension_ for that
gawk -i inplace ...
and
gawk -i inplace -v inplace::suffix=.bak ...
respectively.
That's not exactly as simple to use as, say,
gawk -i ...
and
gawk -i.bak
so I suppose there's a reason for the added complexity in the handling.
Does anyone know that reason or remember a rationale? - I don't recall
any discussions about that...
I've explained this a few times over the years (in this newsgroup).
There was never a "-i" option in Gawk that meant "inplace" (and there never will be).
The key to understanding this is to understand that (in Gawk), the "i" in "-i" does not stand for "inplace". It stands for "include".
Once you understand that, all becomes clear.
In GNU Awk I was looking for the in-place option (similar to sed -i).
I thought there once was some _simple_ option usable from the command
line. (Or am I misremembering?)
The manual now suggests to use a GNU Awk "inplace" _Extension_ for that
gawk -i inplace ...
and
gawk -i inplace -v inplace::suffix=.bak ...
respectively.
That's not exactly as simple to use as, say,
gawk -i ...
and
gawk -i.bak
so I suppose there's a reason for the added complexity in the handling.
Does anyone know that reason or remember a rationale? - I don't recall
any discussions about that...
On 2025-05-23, Kenny McCormack <gazelle@shell.xmission.com> wrote:
In article <100p11m$3uh3m$1@dont-email.me>,
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
In GNU Awk I was looking for the in-place option (similar to sed -i).
I thought there once was some _simple_ option usable from the command
line. (Or am I misremembering?)
The manual now suggests to use a GNU Awk "inplace" _Extension_ for that
gawk -i inplace ...
and
gawk -i inplace -v inplace::suffix=.bak ...
respectively.
That's not exactly as simple to use as, say,
gawk -i ...
and
gawk -i.bak
so I suppose there's a reason for the added complexity in the handling.
Does anyone know that reason or remember a rationale? - I don't recall
any discussions about that...
I've explained this a few times over the years (in this newsgroup).
There was never a "-i" option in Gawk that meant "inplace" (and there never >> will be).
The key to understanding this is to understand that (in Gawk), the "i" in
"-i" does not stand for "inplace". It stands for "include".
Once you understand that, all becomes clear.
Sure, but, interestingly, just like Janis, I also seem to have a false, memory of there having been some other inplace mechanism that was
replaced by the -i inplace include (not necessarily a -i option).
There is no evidence of any such in the available materials, though.
We might have both been duped by something unclear someone said once, (perhaps here)?
In GNU Awk I was looking for the in-place option (similar to sed -i).
I thought there once was some _simple_ option usable from the command
line. (Or am I misremembering?)
The manual now suggests to use a GNU Awk "inplace" _Extension_ for that
gawk -i inplace ...
and
gawk -i inplace -v inplace::suffix=.bak ...
respectively.
....
Does anyone know that reason or remember a rationale? - I don't recall
any discussions about that...
On 5/23/2025 12:28 AM, Janis Papanagnou wrote:
In GNU Awk I was looking for the in-place option (similar to sed -i).
I thought there once was some _simple_ option usable from the command
line. (Or am I misremembering?)
The manual now suggests to use a GNU Awk "inplace" _Extension_ for that
gawk -i inplace ...
and
gawk -i inplace -v inplace::suffix=.bak ...
respectively.
That's not exactly as simple to use as, say,
gawk -i ...
and
gawk -i.bak
so I suppose there's a reason for the added complexity in the handling.
Does anyone know that reason or remember a rationale? - I don't recall
any discussions about that...
The somewhat lengthy discussion at https://lists.gnu.org/archive/html/bug-gawk/2012-12/msg00046.html may
(or may not) be useful.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 498 |
Nodes: | 16 (0 / 16) |
Uptime: | 68:28:52 |
Calls: | 9,814 |
Calls today: | 2 |
Files: | 13,755 |
Messages: | 6,189,407 |