This is a card in Dave's Virtual Box of Cards.

Better AWK?

Page created: 2023-06-07

Back to mushrat or over to better-sed

I love AWK except:

I want AWK’s implicit line parsing to have multiple levels (the first three of which would have default/implicit behavior):

[match] { per line }       <--- what awk does now

[match] { per line
    [match] { per word }
}

[match] { per line
    [match] { per word
        [match] { per char }
    }
}

Just thinking out loud here: I might add string interpolation and implicit variables $l, $w, $c for this behavior.

Then, if I want to print every word inside some square brackets:

{{ print "[$w]" }}

Not sure how that would actually work in practice, but I like it at first blush.