Re: AWK-Editing files in "place" and a --write switch



In article <00e23435-3bae-49f4-ba46-c84876b4c511@xxxxxxxxxxxxxxxxxxxxxxxxxx>,
<rubin1001@xxxxxxxxx> wrote:
Trying to construct a convenient awk option similar to sed -i, I?m
using the following code(s) used as
functions, to edit the file(s) in "place":

If I understand you correctly, your "reason for posting" is that you've
hacked up a "script kludge" way of doing what you want, and are now asking
the maintainers if they would consider implementing this functionality
in the "core" (i.e., in the C source code). Is that correct?

The previous paragraph is _my_ "reason for posting", but I might as well
add a comment or two about the general idea:
1) As far as I'm concerned, the "right way" to do this (*) is to
store up the results in an array, then, in the END block,
dump the array out to the file:
close(FILENAME)
for (i=1; i<=n; i++) print myarray[i] > FILENAME
2) Regarding getting it changed in the source: My guess is that
you'll have better luck going ahead and doing it yourself
(it shouldn't be very difficult) than in getting the
maintainers to do it.

(*) I do this rarely, but in some isolated situations, it has seemed
warranted.

.



Relevant Pages

  • Re: ADSI script for IIS 5.0 can not run in IIS 6.0
    ... The only way to determine "why" is for someone to look at the source code. ... This posting is provided "AS IS" with no warranties, and confers no rights. ... Problem fixed by changing the array for ServerBindings from dynamic array to ...
    (microsoft.public.inetserver.iis)
  • Re: functional programming
    ... But if you're going to tromp over the original array straightaway ... Second-guessing such optimizations and hard-coding them in your source code can make the code more difficult to reason about and deal with in general, because it can put all of the properties I listed at risk. ... Mutation can be encapsulated locally in a controlled way that doesn't lead to problems, for example -- however, 'every' above is not encapsulated in that way. ...
    (comp.lang.scheme)
  • Re: Learn to Program, by Chris Pine
    ... Maybe you should include the full source code. ... The error message says that the right side of an addition is nil. ... What I also think is strange is that "world" seems to be a two dimensional array when you first mention it, but later on you pass it to continent size along with two parameters. ... Even though you wouldn't need the braces as it all of the conditionals need to be true for the whole expression to become true. ...
    (comp.lang.ruby)
  • Re: Design Pattern thoughts
    ... Does that qualify as "source code"? ... What we're interested in is how to write code so that maintainers of ... Suppose you asked me for an outstanding example of poetry, ... type debug (I am of course assuming you are on a windows sytem and ...
    (comp.object)
  • Re: two dimesional array
    ... I was able to look at the source code, and we changed it on the component end. ... I have a component that returns a 2 dimensional array of strings. ... I've even tried to declare a string array with know dimensions but no luck. ...
    (microsoft.public.dotnet.languages.csharp)