Web lists-archives.com

Re: Does bash have a tool ?




On 04.03.18 10:28, Richard Owlett wrote:
> 
> I don't have any background in Perl and the last formal course in
> programming was in the 60's.
> 
> However awk and/or sed may be what I'm looking for and are well documented.
> Your description of nedit is interesting. I'll investigate. I'm on my way
> out at the moment.

Awk and Sed were created in the unix big bang, and might indeed be just
be your speed. (Some enhancements have been added to Awk since, such as
co-processes, but the current use case won't need that.)

It seems you're onto some doco, but this is hard to beat:
The Addison Wesley "The AWK programming Language" is a slender concise
exposition of the tool's use and capabilities, written by Awk's authors,
Aho, Weinberger, and Kernighan. The permuted index greatly eases finding
stuff in it.

This is a quick start: www.gnu.org/software/gawk/manual/gawk.html
Like the Addison Wesley dead-tree book, its "Sample Programs" shows that
Awk has a C-like syntax, supercharged with posix regexes, associative
arrays, etc.

A quick intro to regular expressions can be found in:
$ man regex
(Awk defaults to the more compact and easily read EREs, rather than
obsolete BREs.)

The awk manpage is a good reference, but as with all manpages, not a
tutorial.

Over the last three decades or more, I've found that Awk and shell have
more than adequately handled all my text munging requirements, right up
to a C-code generator taking structured English input to create
heterogenous communities of interacting state machines.

Erik